diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 000000000..9e4a36a51 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,119 @@ +{ + "files": [ + "README.md" + ], + "imageSize": 100, + "commit": false, + "contributors": [ + { + "login": "dgibbs64", + "name": "Daniel Gibbs", + "avatar_url": "https://avatars2.githubusercontent.com/u/4478206?v=4", + "profile": "https://danielgibbs.co.uk", + "contributions": [ + "bug", + "code", + "ideas", + "question", + "review", + "content", + "doc", + "infra" + ] + }, + { + "login": "Frisasky", + "name": "Frisasky", + "avatar_url": "https://avatars2.githubusercontent.com/u/26865851?v=4", + "profile": "https://github.com/Frisasky", + "contributions": [ + "question", + "bug", + "code" + ] + }, + { + "login": "kennyLtv", + "name": "Kenny Lindelof", + "avatar_url": "https://avatars2.githubusercontent.com/u/6133325?v=4", + "profile": "https://kennyl.design", + "contributions": [ + "question" + ] + }, + { + "login": "Scarsz", + "name": "Austin Shapiro", + "avatar_url": "https://avatars1.githubusercontent.com/u/7691988?v=4", + "profile": "https://scarsz.me", + "contributions": [ + "bug", + "code" + ] + }, + { + "login": "marvinlehmann", + "name": "Marvin Lehmann", + "avatar_url": "https://avatars2.githubusercontent.com/u/4151266?v=4", + "profile": "https://github.com/marvinlehmann", + "contributions": [ + "bug", + "code" + ] + }, + { + "login": "Bourne-ID", + "name": "Bourne-ID", + "avatar_url": "https://avatars1.githubusercontent.com/u/7073616?v=4", + "profile": "https://github.com/Bourne-ID", + "contributions": [ + "review", + "content", + "doc", + "infra", + "review" + ] + }, + { + "login": "cedarlug", + "name": "CedarLUG", + "avatar_url": "https://avatars2.githubusercontent.com/u/19336442?v=4", + "profile": "http://cedarlug.org", + "contributions": [ + "bug", + "code", + "ideas", + "question", + "review" + ] + }, + { + "login": "UltimateByte", + "name": "UltimateByte", + "avatar_url": "https://avatars3.githubusercontent.com/u/8805941?v=4", + "profile": "https://www.terageek.org | https://www.haisoft.fr", + "contributions": [ + "bug", + "code", + "doc", + "ideas", + "review" + ] + }, + { + "login": "borzaka", + "name": "Attila", + "avatar_url": "https://avatars0.githubusercontent.com/u/1230402?v=4", + "profile": "https://github.com/borzaka", + "contributions": [ + "code", + "bug" + ] + } + ], + "contributorsPerLine": 7, + "projectName": "LinuxGSM", + "projectOwner": "GameServerManagers", + "repoType": "github", + "repoHost": "https://github.com" +} 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..802343b27 --- /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 \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/PULL_REQUEST_TEMPLATE.md b/.github/ISSUE_TEMPLATE/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..8c40ff457 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,48 @@ +# Description + +Please include a summary of the change and which issues is fixed + +Fixes #[issue] + +## Type of change + +* [ ] Bug fix (change which fixes an issue). +* [ ] New feature (change which adds functionality). +* [ ] New Server (new server added). +* [ ] Refactor (restructures existing code). +* [ ] Comment update (typo, spelling, explanation, examples, etc). + +## Checklist + +PR will not be merged until all steps are complete. + +* [ ] This pull request links to an issue. +* [ ] This pull request uses the `develop` branch as its base. +* [ ] This code follows the style guidelines of this project. +* [ ] I have provided Co-author details below. +* [ ] I have performed a self-review of my own code. +* [ ] I have checked that this code is commented where required. +* [ ] I have provided a detailed enough description of this PR. +* [ ] I have checked If documentation needs updating. + +## Provide Github Email + +Fill out below info or tick box below: +``` +Co-authored-by: John Doe +``` + +- [ ] I do not wish to provide an email. I am aware this will hide me as the author of this commit. + +All pull requests will now be squashed to create a tidy commit history and simplify changelog creation. You can provide either your own email or a GitHub-provided no-reply email. + +When a PR is squashed the author becomes the person who squashed the PR. This removes you as the author of your own PR. +The only workaround for this is to add your details as a co-author. More info about co-authors can be found [here](https://help.github.com/en/articles/creating-a-commit-with-multiple-authors). + +## 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/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..e6555a40e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,46 @@ +--- +name: Bug report +about: Found a bug? Raise a report + +--- +Follow **[this guide](https://linuxgsm.com/support/#guide)** to make sure you post the correct info. +For general support visit the **[LinuxGSM-Support](https://github.com/GameServerManagers/LinuxGSM-Support)**. + +Issues here are **ONLY** for: +* LinuxGSM bugs +* feature suggestions +* code contributions + +Issues here are **NOT** for: +* General support +* Specific game server issues (e.g CS:GO, TF2) +* Dedicated server issues (e.g Ubuntu, CentOS) +* Anything not directly related to LinuxGSM development + +Any general support issues on GitHub will be migrated to [LinuxGSM-Support](https://github.com/GameServerManagers/LinuxGSM-Support). + +*Please use the template below* + +## 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] + +## 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..0f2ccde58 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,40 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- +Follow **[this guide](https://linuxgsm.com/support/#guide)** to make sure you post the correct info. +For general support visit the **[LinuxGSM-Support](https://github.com/GameServerManagers/LinuxGSM-Support)**. + +Issues here are **ONLY** for: +* LinuxGSM bugs +* feature suggestions +* code contributions + +Issues here are **NOT** for: +* General support +* Specific game server issues (e.g CS:GO, TF2) +* Dedicated server issues (e.g Ubuntu, CentOS) +* Anything not directly related to LinuxGSM development + +Any general support issues on GitHub will be migrated to [LinuxGSM-Support](https://github.com/GameServerManagers/LinuxGSM-Support). + +*Please use the template below* + +## 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] + +## 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..d27b3b497 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new-server-request.md @@ -0,0 +1,29 @@ +--- +name: New server request +about: Suggest a new game server to be added + +--- + +## What game server would you like adding? + +[game server] + +## Can you link to any tutorials or guides? + +Provide any useful documentation or resources that might help. + +## Is the server on Steam? + +* [ ] Yes +* [ ] No + +If yes Use SteamDB to get the appid. (https://steamdb.info). + +[appid] + +## Is the server supported on Linux? + +We only support Linux servers and do not support Wine. + +* [ ] Yes +* [ ] No \ No newline at end of file diff --git a/.github/lock.yml b/.github/lock.yml new file mode 100644 index 000000000..dd136ecdc --- /dev/null +++ b/.github/lock.yml @@ -0,0 +1,38 @@ +# Configuration for Lock Threads - https://github.com/dessant/lock-threads + +# Number of days of inactivity before a closed issue or pull request is locked +daysUntilLock: 365 + +# Skip issues and pull requests created before a given timestamp. Timestamp must +# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable +skipCreatedBefore: false + +# Issues and pull requests with these labels will be ignored. Set to `[]` to disable +exemptLabels: [] + +# Label to add before locking, such as `outdated`. Set to `false` to disable +lockLabel: false + +# Comment to post before locking. Set to `false` to disable +lockComment: > + This thread has been automatically locked since there has not been + any recent activity after it was closed. Please open a new issue for + related bugs. + +# Assign `resolved` as the reason for locking. Set to `false` to disable +setLockReason: false + +# Limit to only `issues` or `pulls` +# only: issues + +# Optionally, specify configuration settings just for `issues` or `pulls` +# issues: +# exemptLabels: +# - help-wanted +# lockLabel: outdated + +# pulls: +# daysUntilLock: 30 + +# Repository to extend settings from +# _extends: repo \ No newline at end of file diff --git a/.github/no-response.yml b/.github/no-response.yml new file mode 100644 index 000000000..34cf8d447 --- /dev/null +++ b/.github/no-response.yml @@ -0,0 +1,10 @@ +# Configuration for probot-no-response - https://github.com/probot/no-response + +# Number of days of inactivity before an Issue is closed for lack of response +daysUntilClose: 60 +# Label requiring a response +responseRequiredLabel: "needs more info" +# Comment to post when closing an Issue for lack of response. Set to `false` to disable +closeComment: > + This issue has been automatically closed because there has been no response + to this issue and is now stale. \ No newline at end of file diff --git a/.github/potential-duplicates.yml b/.github/potential-duplicates.yml new file mode 100644 index 000000000..9c973de06 --- /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}} \ No newline at end of file diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 000000000..1387c5e19 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,4 @@ +template: | + ## Changelog + + $CHANGES \ No newline at end of file diff --git a/.github/request-info.yml b/.github/request-info.yml new file mode 100644 index 000000000..1b354d9f7 --- /dev/null +++ b/.github/request-info.yml @@ -0,0 +1,17 @@ +# Configuration for request-info - https://github.com/behaviorbot/request-info + +# *Required* Comment to reply with +requestInfoReplyComment: > + ![More Data required](https://i.imgur.com/yS9cecv.png) + More data is required to assist with this issue + or issue template was not used correctly. + https://linuxgsm.com/support/#guide + +# *OPTIONAL* default titles to check against for lack of descriptiveness +# MUST BE ALL LOWERCASE +#requestInfoDefaultTitles: +# - update readme.md +# - updates + +# *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given +requestInfoLabelToAdd: "needs more info" \ No newline at end of file diff --git a/.github/support.yml b/.github/support.yml new file mode 100644 index 000000000..2f45e92ec --- /dev/null +++ b/.github/support.yml @@ -0,0 +1,15 @@ +# Configuration for support-requests - https://github.com/dessant/support-requests + +# Label used to mark issues as support requests +supportLabel: "Outcome: wrong forum" +# Comment to post on issues marked as support requests. Add a link +# to a support page, or set to `false` to disable +supportComment: > + We use the issue tracker exclusively for bug reports and feature requests. + However, this issue appears to be a support request. Please use our + support channels to get help with the project. + https://linuxgsm.com/support +# Whether to close issues marked as support requests +close: true +# Whether to lock issues marked as support requests +lock: false diff --git a/.github/topissuebot.yml b/.github/topissuebot.yml new file mode 100644 index 000000000..b02540a2d --- /dev/null +++ b/.github/topissuebot.yml @@ -0,0 +1,4 @@ +# Configuration for top-issue-bot +labelName: ":thumbsup: Top Issue!" +labelColor: "f442c2" +numberOfIssuesToLabel: 5 \ No newline at end of file diff --git a/.github/welcome.yml b/.github/welcome.yml new file mode 100644 index 000000000..7a120a2fa --- /dev/null +++ b/.github/welcome.yml @@ -0,0 +1,21 @@ +# Configuration for welcome - https://github.com/behaviorbot/welcome + +# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome + +# Comment to be posted to on first time issues +newIssueWelcomeComment: > + Thank you for opening your first issue. Be sure to follow the issue template! and guide for posting. https://linuxgsm.com/support/#guide + +# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome + +# Comment to be posted to on PRs from first time contributors in your repository +newPRWelcomeComment: > + Thank you for opening this pull request! Please check out our contributing guidelines. + +# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge + +# Comment to be posted to on pull requests merged by a first time user +firstPRMergeComment: > + Congratulations on merging your first pull request! Thank you for supporting LinuxGSM! + +# It is recommend to include as many gifs and emojis as possible \ No newline at end of file diff --git a/.github/write-good.yml b/.github/write-good.yml new file mode 100644 index 000000000..2bdb512ad --- /dev/null +++ b/.github/write-good.yml @@ -0,0 +1,4 @@ +# .github/write-good.yml +writeGood: true +alex: true +spellchecker: true \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index f91811da3..59c6d892b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,47 @@ -language: bash -sudo: false -env: -- DISTRO=ubuntu-trusty +language: node_js +dist: xenial +node_js: + - 10 before_script: - curl -L "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/shunit2/shunit2-2.1.6.tgz" | tar zx - +install: + npm install gamedig addons: apt: - sources: - - ubuntu-toolchain-r-test packages: - - tmux - mailutils - - postfix - - lib32gcc1 - - libstdc++6 - - libstdc++6:i386 - - telnet - - expect - -script: + - postfix + - curl + - wget + - file + - bzip2 + - gzip + - unzip + - bsdmainutils + - python + - util-linux + - ca-certificates + - binutils + - bc + - jq + - tmux + - lib32gcc1 + - libstdc++6 + - libstdc++6:i386 + - net-tools + - iproute2 + - shellcheck - - bash tests/tests_jc2server.sh - - bash tests/tests_ts3server.sh +jobs: + include: + - stage: jobs + script: bash tests/tests_jc2server.sh + - # stage name not required + script: bash tests/tests_fctrserver.sh + - # stage name not required + script: bash tests/tests_mcserver.sh + - # stage name not required + script: bash tests/tests_ts3server.sh + - # retired as codacy does this check. + # script: bash tests/tests_shellcheck.sh diff --git a/7DaysToDie/sdtdserver b/7DaysToDie/sdtdserver deleted file mode 100644 index 1e5bca25e..000000000 --- a/7DaysToDie/sdtdserver +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: 7 Days To Die | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -steamuser="username" -steampass="password" - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | http://7daystodie.gamepedia.com/Server -fn_parms(){ -parms="-logfile ${gamelogdir}/output_log__`date +%Y-%m-%d__%H-%M-%S`.txt -quit -batchmode -nographics -dedicated -configfile=${servercfgfullpath}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="294420" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="7 Days To Die" -engine="unity3d" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="sdtd-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./7DaysToDieServer.x86" -servercfg="${servicename}.xml" -servercfgdefault="serverconfig.xml" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver deleted file mode 100644 index bc4c53812..000000000 --- a/ARKSurvivalEvolved/arkserver +++ /dev/null @@ -1,202 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: ARK: Survival Evolved | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -servername="ark-server" -port="7778" -queryport="27015" -rconport="32330" -rconpassword="" # Set to enable rcon -maxplayers="50" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="\"TheIsland?listen?MultiHome=${ip}?SessionName=${servername}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?ServerAdminPassword=${rconpassword}\"" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="376030" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="ARK: Survivial Evolved" -engine="unreal4" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ark-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/ShooterGame" -executabledir="${systemdir}/Binaries/Linux" -executable="./ShooterGameServer" -servercfgdir="${systemdir}/Saved/Config/LinuxServer" -servercfg="GameUserSettings.ini" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/GameUserSettings.ini" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh diff --git a/Arma3/arma3server b/Arma3/arma3server deleted file mode 100644 index b132595a5..000000000 --- a/Arma3/arma3server +++ /dev/null @@ -1,219 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: ARMA 3 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -steamuser="username" -steampass="password" - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/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 Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="-netlog -ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods} -servermod=${servermods} -bepath=${bepath} -autoinit -loadmissiontomemory" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="233780" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="ARMA 3" -engine="realvirtuality" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="arma3-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./arma3server" -servercfg="${servicename}.server.cfg" -networkcfg="${servicename}.network.cfg" -servercfgdefault="server.cfg" -networkcfgdefault="network.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -networkcfgfullpath="${servercfgdir}/${networkcfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -#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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh diff --git a/Battlefield1942/bf1942server b/Battlefield1942/bf1942server deleted file mode 100644 index d011e57ac..000000000 --- a/Battlefield1942/bf1942server +++ /dev/null @@ -1,185 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Battlefield: 1942 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -fn_parms(){ -parms="+hostServer 1 +dedicated 1" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Battlefield: 1942" -engine="refractor" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="bf1942-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${systemdir}" -executable="./start.sh" -servercfg="serversettings.con" -servercfgdefault="serversettings.con" -servercfgdir="${systemdir}/mods/bf1942/settings" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${filesdir}/Logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh diff --git a/BlackMesa/bmdmserver b/BlackMesa/bmdmserver deleted file mode 100644 index 025374c70..000000000 --- a/BlackMesa/bmdmserver +++ /dev/null @@ -1,207 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Black Mesa: Deathmatch | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="dm_bounce" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Optional: Game Server Login Token -# GSLT can be used for running a public server. -# More info: https://gameservermanagers.com/gslt -gslt="" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## SteamCMD Settings -# Server appid -appid="346680" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## LinuxGSM Server Details -# Do not edit -gamename="Black Mesa: Deathmatch" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="bmdm-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/bms" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directorie -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh diff --git a/BladeSymphony/bsserver b/BladeSymphony/bsserver deleted file mode 100644 index 5e1a91654..000000000 --- a/BladeSymphony/bsserver +++ /dev/null @@ -1,197 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Blade Symphony | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -steamuser="username" -steampass="password" - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="duel_winter" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="228780" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## LinuxGSM Server Details -# Do not edit -gamename="Blade Symphony" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="bs-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/berimbau" -executabledir="${filesdir}" -executable="./srcds_run.sh" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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 '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh diff --git a/BrainBread2/bb2server b/BrainBread2/bb2server deleted file mode 100644 index 977e60025..000000000 --- a/BrainBread2/bb2server +++ /dev/null @@ -1,209 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: BrainBread 2 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -# Steam login -steamuser="username" -steampass="password" - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="bba_barracks" -maxplayers="20" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Optional: Game Server Login Token -# GSLT can be used for running a public server. -# More info: https://gameservermanagers.com/gslt -gslt="" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game brainbread2 -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="475370" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="BrainBread 2" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="bb2-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/brainbread2" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh 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..764f21e19 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,36 @@ +# How to contribute to LinuxGSM + +We are really glad you're reading this, because if you are then you have shown an interest in helping make LinuxGSM great. + +If you haven't already, come find us on [Discord](https://linuxgsm.com/discord). From there you will have contact with other contributers of the project. We want you working on things you're excited about. + +Before working on a project we recommend that you create a issue in regards to the issue/feature. This will prevent duplicates while you work on the feature. If an issue already exists, make note that you are working on it so nobody else wastes their time working on the same project at the same time! + +Here are some important resources: + + * [Issues Page](https://github.com/GameServerManagers/LinuxGSM/issues) provides a list of areas that could use some work, + * [Developer Wiki](https://github.com/GameServerManagers/LinuxGSM/wiki) gives a detailed guide on developing LGSM, + +## Testing + +Please make sure all the code you write is working properly **before** you create a pull request. Information on debugging can be found in the following document: + +[Developer Commands](https://github.com/GameServerManagers/LinuxGSM/wiki/Developer-Commands) + +## Submitting changes + +Please send a [GitHub Pull Request to LinuxGSM](https://github.com/GameServerManagers/LinuxGSM/pull/new/develop) with a clear list of what you've done (read more about [pull requests](https://help.github.com/articles/about-pull-requests)). Please follow our coding conventions (below) and make sure all of your commits are atomic (one feature per commit). + +Always write a clear log message for your commits. One-line messages are fine for small changes, but bigger changes should look like this: + + $ git commit -m "A brief summary of the commit + > + > A paragraph describing what changed and its impact." +This will help us in understanding your code and determining where problems may arise. + +## Coding conventions + +Start reading our code and you'll get the hang of it. Explore how functions are organized and you'll see how we strive for readable code. + +Please give the following document a read and adjust your code according to its specifications. +[Syntax & Coding Conventions](https://github.com/GameServerManagers/LinuxGSM/wiki/Syntax-and-Conventions) \ No newline at end of file diff --git a/CallOfDuty/codserver b/CallOfDuty/codserver deleted file mode 100755 index 8bf07b570..000000000 --- a/CallOfDuty/codserver +++ /dev/null @@ -1,187 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Call of Duty | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="mp_neuville" -maxclients="20" -port="28960" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set fs_basepath ${filesdir} +set dedicated 1 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxclients} +exec ${servercfg} +map ${defaultmap}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### Advanced Variables #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Call of Duty" -engine="idtech3" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="cod-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./cod_lnxded" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/main" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${filesdir}/Logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/CallOfDuty2/cod2server b/CallOfDuty2/cod2server deleted file mode 100755 index 49a32f1e5..000000000 --- a/CallOfDuty2/cod2server +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Call of Duty 2 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters - -defaultmap="mp_leningrad" -maxclients="20" -port="28960" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set fs_basepath ${filesdir} +set dedicated 1 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxclients} +exec ${servercfg} +map ${defaultmap}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### Advanced Variables #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Call of Duty 2" -engine="iw2.0" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="cod2-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./cod2_lnxded" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/main" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${filesdir}/Logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/CallOfDutyUnitedOffensive/coduoserver b/CallOfDutyUnitedOffensive/coduoserver deleted file mode 100755 index 37e053e10..000000000 --- a/CallOfDutyUnitedOffensive/coduoserver +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Call of Duty: United Offensive | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters - -defaultmap="mp_cassino" -maxclients="20" -port="28960" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set fs_basepath ${filesdir} +set dedicated 1 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxclients} +exec ${servercfg} +map ${defaultmap}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### Advanced Variables #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Call of Duty: United Offensive" -engine="idtech3" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="coduo-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./coduo_lnxded" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/uo" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${filesdir}/Logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/CallOfDutyWorldAtWar/codwawserver b/CallOfDutyWorldAtWar/codwawserver deleted file mode 100755 index c5bfbf785..000000000 --- a/CallOfDutyWorldAtWar/codwawserver +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Call of Duty: World at War | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters - -defaultmap="mp_castle" -maxclients="20" -port="28960" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set fs_basepath ${filesdir} +set dedicated 1 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxclients} +exec ${servercfg} +map ${defaultmap}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### Advanced Variables #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Call of Duty: World at War" -engine="iw3.0" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="codwaw-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./codwaw_lnxded" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/main" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${filesdir}/Logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/CodenameCURE/ccserver b/CodenameCURE/ccserver deleted file mode 100644 index 0fcd67964..000000000 --- a/CodenameCURE/ccserver +++ /dev/null @@ -1,199 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Codename CURE | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="cbe_bunker" -maxplayers="6" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game cure -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="383410" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Codename CURE" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="cc-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/cure" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/CounterStrike/csserver b/CounterStrike/csserver deleted file mode 100644 index 8fae4ad6d..000000000 --- a/CounterStrike/csserver +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Counter-Strike | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="de_dust2" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### Advanced Variables #### - -## SteamCMD Settings -# Server appid -appid="90" -appidmod="cstrike" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Counter-Strike 1.6" -engine="goldsource" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="cs-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/cstrike" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/CounterStrikeConditionZero/csczserver b/CounterStrikeConditionZero/csczserver deleted file mode 100644 index 21b58f060..000000000 --- a/CounterStrikeConditionZero/csczserver +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Counter-Strike: Condition Zero | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="de_dust2" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="90" -appidmod="czero" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Counter-Strike: Condition Zero" -engine="goldsource" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="cscz-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/czero" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/CounterStrikeGlobalOffensive/csgoserver b/CounterStrikeGlobalOffensive/csgoserver deleted file mode 100755 index 00234ea57..000000000 --- a/CounterStrikeGlobalOffensive/csgoserver +++ /dev/null @@ -1,224 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Counter-Strike: Global Offensive | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -# 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 -gametype="0" -gamemode="0" -defaultmap="de_dust2" -mapgroup="random_classic" -maxplayers="16" -tickrate="64" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Required: Game Server Login Token -# GSLT is required for running a public server. -# More info: https://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="" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="740" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Counter-Strike: Global Offensive" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="csgo-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/csgo" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/CounterStrikeSource/cssserver b/CounterStrikeSource/cssserver deleted file mode 100644 index 6710cd78d..000000000 --- a/CounterStrikeSource/cssserver +++ /dev/null @@ -1,207 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Counter-Strike: Source | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="de_dust2" -maxplayers="16" -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: https://gameservermanagers.com/gslt -gslt="" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="232330" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Counter-Strike: Source" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="css-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/cstrike" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/DayOfDefeat/dodserver b/DayOfDefeat/dodserver deleted file mode 100644 index f1638263e..000000000 --- a/DayOfDefeat/dodserver +++ /dev/null @@ -1,202 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Day of Defeat | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="dod_Anzio" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="90" -appidmod="dod" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Day of Defeat" -engine="goldsource" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="dod-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/dod" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/DayOfDefeatSource/dodsserver b/DayOfDefeatSource/dodsserver deleted file mode 100644 index bee83c953..000000000 --- a/DayOfDefeatSource/dodsserver +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Day of Defeat: Source | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="dod_Anzio" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | ttps://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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="232290" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Day of Defeat: Source" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="dods-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/dod" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/DayOfInfamy/doiserver b/DayOfInfamy/doiserver deleted file mode 100644 index da1605b39..000000000 --- a/DayOfInfamy/doiserver +++ /dev/null @@ -1,204 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Day of Infamy | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="bastogne" -maxplayers="16" -tickrate="64" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -workshop="0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game doi -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} +sv_workshop_enabled ${workshop}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="462310" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Day of Infamy" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="doi-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/doi" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/DeathmatchClassic/dmcserver b/DeathmatchClassic/dmcserver deleted file mode 100644 index 58b6c4282..000000000 --- a/DeathmatchClassic/dmcserver +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Deathmatch Classic | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="dcdm5" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="90" -appidmod="dmc" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Deathmatch Classic" -engine="goldsource" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="dmc-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/dmc" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/DontStarveTogether/dstserver b/DontStarveTogether/dstserver deleted file mode 100644 index 260a57a39..000000000 --- a/DontStarveTogether/dstserver +++ /dev/null @@ -1,207 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Dont Starve Together | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Installation Variables | https://github.com/GameServerManagers/LinuxGSM/wiki/Don't-Starve-Together -sharding="false" -master="true" -shard="Master" -cluster="Cluster_1" -cave="false" - -# Edit with care -persistentstorageroot="${HOME}/.klei" -confdir="DoNotStarveTogether" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -fn_parms(){ -parms="-persistent_storage_root ${persistentstorageroot} -conf_dir ${confdir} -cluster ${cluster} -shard ${shard}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="343050" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Don't Starve Together" -engine="dontstarve" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="dst-server-${shard}" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}/bin" -executable="./dontstarve_dedicated_server_nullrenderer" -clustercfg="cluster.ini" -clustercfgdir="${persistentstorageroot}/${confdir}/${cluster}" -clustercfgfullpath="${clustercfgdir}/${clustercfg}" -clustercfgdefault="cluster.ini" -servercfg="server.ini" -servercfgdir="${clustercfgdir}/${shard}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="server.ini" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh diff --git a/DoubleActionBoogaloo/dabserver b/DoubleActionBoogaloo/dabserver deleted file mode 100644 index 0938bd94a..000000000 --- a/DoubleActionBoogaloo/dabserver +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Double Action: Boogaloo | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="da_rooftops" -maxplayers="10" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="317800" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Double Action: Boogaloo" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="dab-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/dab" -executabledir="${filesdir}" -executable="./dabds.sh" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/EmpiresMod/emserver b/EmpiresMod/emserver deleted file mode 100644 index 7fe58d3b5..000000000 --- a/EmpiresMod/emserver +++ /dev/null @@ -1,185 +0,0 @@ -#!/bin/bash -# Empires Mod - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="emp_district" -maxplayers="62" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Optional: Game Server Login Token -# GSLT can be used for running a public server. -# More info: https://gameservermanagers.com/gslt -gslt="" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game empires -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="460040" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Empires Mod" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="em-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/empires" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/FistfulOfFrags/fofserver b/FistfulOfFrags/fofserver deleted file mode 100644 index 224ad89db..000000000 --- a/FistfulOfFrags/fofserver +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Fistful Of Frags | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="fof_depot" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="295230" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Fistful of Frags" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="fof-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/fof" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/GarrysMod/gmodserver b/GarrysMod/gmodserver deleted file mode 100644 index 379e36a08..000000000 --- a/GarrysMod/gmodserver +++ /dev/null @@ -1,217 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Garry's Mod | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="gm_construct" -gamemode="sandbox" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -tickrate="66" -ip="0.0.0.0" - -## Workshop Parameters | http://wiki.garrysmod.com/page/Workshop_for_Dedicated_Servers -workshopauth="" -workshopcollectionid="" - -## Custom Start Parameters -# Default +r_hunkalloclightmaps 0, fixes a start issue on maps with many lights -customparms="+r_hunkalloclightmaps 0" - -## Optional: Game Server Login Token -# GSLT can be used for running a public server. -# More info: https://gameservermanagers.com/gslt -gslt="" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} -tickrate ${tickrate} +host_workshop_collection ${workshopcollectionid} -authkey ${workshopauth} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers} ${customparms}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off] -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="4020" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Garry's Mod" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="gmod-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/garrysmod" -addonsdir="${systemdir}/addons" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh diff --git a/GoldenEyeSource/gesserver b/GoldenEyeSource/gesserver deleted file mode 100644 index c661a3d91..000000000 --- a/GoldenEyeSource/gesserver +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: GoldenEye: Source | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -# Start Variables -defaultmap="ge_archives" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game gesource -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="310" # Source 2007 SDK -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="GoldenEye: Source" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ges-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/gesource" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/HalfLife2Deathmatch/hl2dmserver b/HalfLife2Deathmatch/hl2dmserver deleted file mode 100644 index 49be6d637..000000000 --- a/HalfLife2Deathmatch/hl2dmserver +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Half Life 2: Deathmatch | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="dm_lockdown" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="232370" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Half Life 2: Deathmatch" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="hl2dm-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/hl2mp" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/HalfLifeDeathmatch/hldmserver b/HalfLifeDeathmatch/hldmserver deleted file mode 100644 index 53bd98dc4..000000000 --- a/HalfLifeDeathmatch/hldmserver +++ /dev/null @@ -1,200 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Half Life: Deathmatch | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="crossfire" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="90" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Half Life: Deathmatch" -engine="goldsource" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="hldm-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/valve" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/HalfLifeDeathmatchSource/hldmsserver b/HalfLifeDeathmatchSource/hldmsserver deleted file mode 100644 index d0c9c33db..000000000 --- a/HalfLifeDeathmatchSource/hldmsserver +++ /dev/null @@ -1,204 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Half-Life Deathmatch: Source | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="crossfire" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="255470" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Half-Life Deathmatch: Source" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="hldms-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/hl1mp" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver deleted file mode 100644 index 930f367be..000000000 --- a/Hurtworld/hwserver +++ /dev/null @@ -1,214 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Hurtworld | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -servername="Hurtworld LGSM Server" -ip="0.0.0.0" -port="12871" -queryport="12881" -maxplayers="20" -map="" #Optional -creativemode="0" #Free Build: creativemode="1" -logfile="gamelog.txt" - -## Adding admins using STEAMID64 -# Example : addadmin 012345678901234567; addadmin 987654321098765432 -admins="" - -## Advanced Server Start Settings -# Rollback server state (remove after start command) -loadsave="" -# Use unstable 64 bit server executable (O/1) -x64mode="0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | http://hurtworld.wikia.com/wiki/Hosting_A_Server -fn_parms(){ -parms="-batchmode -nographics -exec \"host ${port} ${map} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\" -logfile \"${logfile}\" " -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="405100" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Hurtworld" -engine="unity3d" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="hurtworld-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -if [ "${x64mode}" == "1" ]; then - executable="./Hurtworld.x86_64" -else - executable="./Hurtworld.x86" -fi - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..c08b7705a --- /dev/null +++ b/ISSUE_TEMPLATE.md @@ -0,0 +1,15 @@ +Follow **[this guide](https://linuxgsm.com/support/#guide)** to make sure you post the correct info. +For general support visit the **[LinuxGSM-Support](https://github.com/GameServerManagers/LinuxGSM-Support)**. + +Issues here are **ONLY** for: +* LinuxGSM bugs +* feature suggestions +* code contributions + +Issues here are **NOT** for: +* General support +* Specific game server issues (e.g CS:GO, TF2) +* Dedicated server issues (e.g Ubuntu, CentOS) +* Anything not directly related to LinuxGSM development + +Any general support issues on GitHub will be closed. diff --git a/Insurgency/cfg/lgsm-default.cfg b/Insurgency/cfg/lgsm-default.cfg deleted file mode 100644 index b8a98558c..000000000 --- a/Insurgency/cfg/lgsm-default.cfg +++ /dev/null @@ -1,302 +0,0 @@ -// **************************************************************************** -// * -// Ingurgency - server.cfg * -// Version 060116 * -// * -// **************************************************************************** - -// ............................. Basic Settings ............................. // - -// Hostname for server. -hostname "" - -// 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 - -// Set maximum server FPS -// Default: fps_max 300 -fps_max 300 - -// ........................... RCON Configuration .......................... // - -// RCON - remote console password. -rcon_password "" - -// Number of minutes to ban users who fail rcon authentication -// min. 0 -sv_rcon_banpenalty 10 - -// Enable/disable rcon logging -sv_rcon_log 1 - -// Max number of times a user can fail rcon authentication before being banned -// min. 1 max. 20 -sv_rcon_maxfailures 5 - -// ......................... 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_conquer.txt" - conquer gamemode -// "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" - -// .......................... Coop Mode Settings ............................ // -// info: Settings for all cooperative gamemodes - -// Set the maximum number of human players in Cooperative modes -// Maximum value: 8 -// Default: mp_coop_lobbysize 6 -//mp_coop_lobbysize 6 - -// Set the minimum number of bots -//mp_coop_min_bots 5 - -// Set the maximum number of bots -// Maximum value: maxplayers - mp_coop_lobbysize -//mp_coop_max_bots 18 - -// ........................... Voting Settings .............................. // - -// Allow voting? -sv_allow_votes 1 - -// Is map voting enabled? -sv_map_voting 1 - -// Allow spectators to vote? -sv_vote_allow_spectators 0 - -// A vote that fails cannot be re-submitted for this long -sv_vote_failure_timer 300 - -// Can people hold votes to change AI count? -sv_vote_issue_botcount_allowed 1 - -// The voting population required to pass a bot count vote -// min. 0.1 max. 1 -sv_vote_issue_botcount_min_population 0.55 - -// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes) -// min. 0 max. 1 -sv_vote_issue_botcount_min_ratio 0.5 - -// Can people hold votes to change AI difficulty? -sv_vote_issue_botdifficulty_allowed 1 - -// The voting population required to pass an AI difficulty vote -// min. 0.1 max. 1 -sv_vote_issue_botdifficulty_min_population 0.55 - -// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes) -// min. 0 max. 1 -sv_vote_issue_botdifficulty_min_ratio 0.5 - -// Can people hold votes to change the gamemode? -sv_vote_issue_changegamemode_allowed 0 - -// Can people hold votes to change levels? -sv_vote_issue_changelevel_allowed 1 - -// If enabled, wait until the end of the round to change levels -sv_vote_issue_changelevel_wait 1 - -// Can people hold votes to kick players from the server? -sv_vote_issue_kick_allowed 1 - -// Can we kick the other team? -sv_vote_issue_kick_other_team 0 - -// Can people hold votes to set the next level? -sv_vote_issue_nextlevel_allowed 1 - -// Allow players to extend the current map? -sv_vote_issue_nextlevel_allowextend 0 - -// Present players with a list of maps to choose from? -sv_vote_issue_nextlevel_choicesmode 1 - -// Not allowed to vote for a nextlevel if one has already been set -sv_vote_issue_nextlevel_prevent_change 1 - -// How many rounds before map voting can begin -sv_vote_issue_nextlevel_round_count_delay 1 - -// The voting population required to pass a next level vote -// min. 0.1 max. 1 -sv_vote_issue_nextlevel_min_population 0.55 - -// How strong does the yes vote need to be to win? (2.0 = 2x more voters) -// min. 1 max. 5 -sv_vote_issue_nextlevel_min_ratio 0.5 - -// Can people hold votes to restart the game? -sv_vote_issue_restart_game_allowed 1 - -// Can people hold votes to restart the round? -sv_vote_issue_restart_round_allowed 1 - -// Can people hold votes to scramble the teams? -sv_vote_issue_scramble_teams_allowed 1 - -// Can people hold votes to switch the teams? -sv_vote_issue_switch_teams_allowed 1 - -// How long should a kick ban last for if a player is kicked for hacking? (minutes) -sv_vote_kick_ban_duration_cheating 240 - -// The voting population required to kick a person for hacking -// min. 0.1 max. 1 -sv_vote_kick_hack_min_population 0.60 - -// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes) -// min. 0 max. 1 -sv_vote_kick_hack_min_ratio 0.66 - -// How long should a kick vote ban someone from the server? (in minutes) -sv_vote_kick_ban_duration_idle 0 - -// The voting population required to kick a person for being idle -// min. 0.1 max. 1 -sv_vote_kick_idle_min_population 0.20 - -// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes) -// min. 0 max. 1 -sv_vote_kick_idle_min_ratio 0.5 - -// How long should a kick ban last for if a player is kicked for team killing? (minutes) -sv_vote_kick_ban_duration_teamkilling 10 - -// The voting population required to kick a person for team killing -// min. 0.1 max. 1 -sv_vote_kick_tk_min_population 0.25 - -// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes) -// min. 0 max. 1 -sv_vote_kick_tk_min_ratio 0.66 - -// How long should a kick ban last for if a player is kicked for trolling? (minutes) -sv_vote_kick_ban_duration_trolling 60 - -// The voting population required to kick a person for trolling -// min. 0.1 max. 1 -sv_vote_kick_troll_min_population 0.40 - -// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes) -// min. 0 max. 1 -sv_vote_kick_troll_min_ration 0.66 - -// The minimum number of players needed on the server to start a vote kick -sv_vote_kick_min_players 4 - -// Minimum number of vote attempts required to start an actual vote -sv_vote_kick_min_voters 3 - -// The voting population required -// min. 0 max. 1 -sv_vote_min_population 0.55 - -// What ratio of the votes needs to be yes to pass? (1 = All votes need to be yes) -// min. 0 max. 1 -sv_vote_min_ratio 0.55 - -// ............................. 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/insserver b/Insurgency/insserver deleted file mode 100644 index 6427fcdb7..000000000 --- a/Insurgency/insserver +++ /dev/null @@ -1,206 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Insurgency | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="ministry" -maxplayers="16" -tickrate="64" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -workshop="0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} +sv_workshop_enabled ${workshop} -norestart" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="237410" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Insurgency" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ins-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/insurgency" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/JustCause2/jc2server b/JustCause2/jc2server deleted file mode 100644 index 1a4fa6c9a..000000000 --- a/JustCause2/jc2server +++ /dev/null @@ -1,194 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Just Cause 2 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### -# No settings available for Just Cause 2 - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="261140" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Just Cause 2" -engine="avalanche" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="jc2-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./Jcmp-Server" -servercfg="config.lua" -servercfgdefault="config.lua" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -#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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/KillingFloor/kfserver b/KillingFloor/kfserver deleted file mode 100644 index 53080e2a7..000000000 --- a/KillingFloor/kfserver +++ /dev/null @@ -1,206 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Killing Floor | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -steamuser="username" -steampass="password" - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="KF-BioticsLab.rom" -ip="0.0.0.0" - -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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="215360" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Killing Floor" -engine="unreal2" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="kf-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/System" -executabledir="${systemdir}" -executable="./ucc-bin" -servercfg="${servicename}.ini" -servercfgdefault="Default.ini" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -compressedmapsdir="${rootdir}/Maps-Compressed" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" -gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/LICENSE b/LICENSE index 24a57533c..9bcd64251 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Daniel Gibbs +Copyright (c) 2018 Daniel Gibbs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Left4Dead/l4dserver b/Left4Dead/l4dserver deleted file mode 100644 index b550880fa..000000000 --- a/Left4Dead/l4dserver +++ /dev/null @@ -1,200 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Left 4 Dead | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="l4d_hospital01_apartment" -maxplayers="8" -port="27015" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game left4dead -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="222840" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Left 4 Dead" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="l4d-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/left4dead" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/Left4Dead2/l4d2server b/Left4Dead2/l4d2server deleted file mode 100644 index 8aee908b5..000000000 --- a/Left4Dead2/l4d2server +++ /dev/null @@ -1,200 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Left 4 Dead 2 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="c5m1_waterfront" -maxplayers="8" -port="27015" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="222860" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Left 4 Dead 2" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="l4d2-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/left4dead2" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/Minecraft/mcserver b/Minecraft/mcserver deleted file mode 100644 index 320edc90d..000000000 --- a/Minecraft/mcserver +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Minecraft | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -javaram="1024" # -Xmx$1024M - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="nogui" -} -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Minecraft" -engine="lwjgl2" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="mc-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="java -Xmx${javaram}M -jar minecraft_server.jar" -servercfg="server.properties" -servercfgdefault="server.properties" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.ini" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver deleted file mode 100644 index be06c44ef..000000000 --- a/Mumble/mumbleserver +++ /dev/null @@ -1,185 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Mumble | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### -# Use .ini config file for Mumble (Murmur) server. - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="-fg -ini ${servercfgfullpath}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Mumble" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="mumble-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./murmur.x86" -servercfg="${servicename}.ini" -servercfgdefault="murmur.ini" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/NS2Combat/ns2cserver b/NS2Combat/ns2cserver deleted file mode 100644 index 437921ad3..000000000 --- a/NS2Combat/ns2cserver +++ /dev/null @@ -1,211 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: NS2: Combat | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -steamuser="username" -steampass="password" - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="co_core" -port="27015" -maxplayers="24" -ip="0.0.0.0" -servername="NS2C Server" -webadminuser="admin" -webadminpass="admin" -webadminport="8080" -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}\" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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 \"${servercfgdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="313900" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="NS2: Combat" -engine="spark" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ns2c-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}/ia32" -executable="./ns2combatserver_linux32" -servercfgdir="${rootdir}/server1" -servercfgfullpath="${servercfgdir}" -modstoragedir="${servercfgdir}/Workshop" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/NaturalSelection2/ns2server b/NaturalSelection2/ns2server deleted file mode 100644 index 3ce13f844..000000000 --- a/NaturalSelection2/ns2server +++ /dev/null @@ -1,211 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Natural Selection 2 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -steamuser="username" -steampass="password" - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="ns2_summit" -port="27015" -maxplayers="24" -ip="0.0.0.0" -servername="NS2 Server" -webadminuser="admin" -webadminpass="admin" -webadminport="8080" -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}\" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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 \"${servercfgdir}\" -logdir \"${gamelogdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="4940" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Natural Selection 2" -engine="spark" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ns2-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./server_linux32" -servercfgdir="${rootdir}/server1" -servercfgfullpath="${servercfgdir}" -modstoragedir="${servercfgdir}/Workshop" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/NoMoreRoomInHell/nmrihserver b/NoMoreRoomInHell/nmrihserver deleted file mode 100644 index 6409591fc..000000000 --- a/NoMoreRoomInHell/nmrihserver +++ /dev/null @@ -1,206 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: No More Room in Hell | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="nmo_broadway" -maxplayers="8" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Optional: Game Server Login Token -# GSLT can be used for running a public server. -# More info: https://gameservermanagers.com/gslt -gslt="" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="317670" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="No More Room in Hell" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="nmrih-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/nmrih" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/OpposingForce/opforserver b/OpposingForce/opforserver deleted file mode 100644 index 8fe185650..000000000 --- a/OpposingForce/opforserver +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Half-Life: Opposing Force | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="op4_bootcamp" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="90" -appidmod="gearbox" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Half-Life: Opposing Force" -engine="goldsource" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="opfor-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/gearbox" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/PiratesVikingandKnightsII/pvkiiserver b/PiratesVikingandKnightsII/pvkiiserver deleted file mode 100644 index e2c920423..000000000 --- a/PiratesVikingandKnightsII/pvkiiserver +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: No More Room in Hell | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="bt_island" -maxplayers="24" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="17575" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Pirates, Vikings, and Knights II" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="pvkii-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/pvkii" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/ProjectZomboid/pzserver b/ProjectZomboid/pzserver deleted file mode 100644 index 481dbdd75..000000000 --- a/ProjectZomboid/pzserver +++ /dev/null @@ -1,195 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Project Zomboid | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -adminpassword="CHANGE_ME" -ip="0.0.0.0" - -fn_parms(){ -parms="-ip ${ip} -adminpassword \"${adminpassword}\" -servername ${servicename}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="380870" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Project Zomboid" -engine="projectzomboid" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="pz-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./start-server.sh" -servercfg="${servicename}.ini" -servercfgdefault="server.ini" -servercfgdir="${HOME}/Zomboid/Server" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/Quake2/q2server b/Quake2/q2server deleted file mode 100644 index 206ab8379..000000000 --- a/Quake2/q2server +++ /dev/null @@ -1,185 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Quake 2 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="q2dm1" -ip="0.0.0.0" -port="27910" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -fn_parms(){ -parms="+set dedicated 1 +set ip ${ip} +set port ${port} +exec ${servercfg} +set deathmatch 1 +map ${defaultmap}" -} -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Quake 2" -engine="idtech2" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="quake2server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/baseq2" -executabledir="${filesdir}" -executable="./quake2" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${filesdir}/Logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/Quake3/q3server b/Quake3/q3server deleted file mode 100644 index ae71118ec..000000000 --- a/Quake3/q3server +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Quake 3: Arena | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="q3dm17" -ip="0.0.0.0" -port="27960" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set fs_basepath ${filesdir} +set dedicated 1 +set com_hunkMegs 32 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Quake 3: Arena" -engine="idtech3" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="quake3-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/baseq3" -executabledir="${filesdir}" -executable="./q3ded" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${filesdir}/Logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/QuakeLive/qlserver b/QuakeLive/qlserver deleted file mode 100755 index d7be6d83d..000000000 --- a/QuakeLive/qlserver +++ /dev/null @@ -1,205 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Quake Live | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -arch="x64" # x64 or x86 -port="27960" -rconport="28960" -rconpassword="CHANGE_ME" -statsport="${port}" -statspassword="CHANGE_ME" -mappool='mappool.txt' -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | Install/Config Guide : https://steamcommunity.com/sharedfiles/filedetails/?id=542966946 -# Console Commands : http://www.regurge.at/ql/ -fn_parms(){ -parms="+set net_strict 1 +set net_ip ${ip} +set net_port ${port} +set fs_homepath ${filesdir}/${port} +set zmq_rcon_enable 1 +set zmq_rcon_port ${rconport} +set zmq_rcon_password ${rconpassword} +set zmq_stats_enable 1 +set zmq_stats_password ${statspassword} +set zmq_stats_port ${statsport} +set sv_mapPoolFile ${mappool} +exec ${servercfg}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="349090" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Quake Live" -engine="idtech3_ql" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ql-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable=$([ "${arch}" == 'x64' ] && echo "./run_server_x64.sh" || echo "./run_server_x86.sh") -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${filesdir}/baseq3" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/QuakeWorld/cfg/lgsm-default.cfg b/QuakeWorld/cfg/lgsm-default.cfg deleted file mode 100644 index e3da2497b..000000000 --- a/QuakeWorld/cfg/lgsm-default.cfg +++ /dev/null @@ -1,26 +0,0 @@ -// server info -hostname "" // server name shown in server browsers -rcon_password "" -sv_admininfo "lgsm " // admin name shown in server browsers - -// motd (max 15 rows) - this is the welcome message displayed when you connect to a server -set k_motd1 "" -set k_motd2 " " -set k_motd3 "Available game modes:" -set k_motd4 "1on1, 2on2, 4on4, 10on10, ffa, ctf" -//set k_motd5 "line 5" // etc.. - -set k_motd_time "5" // time motd is displayed in seconds - - -// edit the lines below if you want different gamemodes on this port -// matchless mode -set k_matchless 0 // run ktx as a regular match server or as a matchless (ffa) server (0 = regular, 1 = matchless) -set k_use_matchless_dir 1 // use configs/usermodes/matchless instead of [...]/ffa (0 = no, 1 = yes) - -// free modes -set k_defmode 2on2 // default mode on server -set k_allowed_free_modes 255 // allowed free modes (bit mask): - // 1=1on1, 2=2on2, 4=3on3, 8=4on4, 16=10on10, 32=ffa 64=ctf 128=hoonymode -set k_defmap dm4 // server homemap. server will change to this when last player leaves the server -set k_mode 2 // server mode (1 = duel, 2 = team, 3 = ffa, 4 = ctf) diff --git a/QuakeWorld/qwserver b/QuakeWorld/qwserver deleted file mode 100644 index 5e1bb60de..000000000 --- a/QuakeWorld/qwserver +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash -# Quake World (nQuake) -# Server Management Script -# Author: Daniel Gibbs -# Website: https://gameservermanagers.com -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="210516" - -#### Variables #### - -# Notification Alerts -# (on|off) - -# Email -emailalert="off" -email="email@example.com" - -# Pushbullet -# https://www.pushbullet.com/#settings -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -# Start Variables -ip="0.0.0.0" -port="27500" - -fn_parms(){ -parms="-port ${port} -game ktx +exec ${servercfg}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -# Server Details -servicename="quakeworld_server" -gamename="QuakeWorld" -engine="quake" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/ktx" -executabledir="${filesdir}" -executable="./mvdsv" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${filesdir}/Logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" -consolelogging="on" - -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 - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_dl.sh -core_functions.sh - -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/README.md b/README.md index 72e57fa62..a028258e8 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,64 @@ -

Linux Game Server Managers_

-linux Game Server Managers - -[![Build Status](https://travis-ci.org/GameServerManagers/LinuxGSM.svg?branch=master)](https://travis-ci.org/GameServerManagers/LinuxGSM) -[![Under Development](https://badge.waffle.io/GameServerManagers/LinuxGSM.svg?label=Under%20Development&title=Under%20Development)](http://waffle.io/GameServerManagers/LinuxGSM) - -The Linux Game Server Managers are command line tools for quick, simple deployment and management of various dedicated game servers and voice alert 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
  • -
  • Alerts (Email, Pushbullet)
  • -
  • 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.).
  • -
-Other distros are likely to work but are not fully tested. -

Specific Requirements

- -

FAQ

-All FAQ can be found here. - -https://github.com/GameServerManagers/LinuxGSM/wiki/FAQ -

Donate

-If you want to donate to the project you can via PayPal. 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

- -

Social

-
    -
  • Steam Group
  • -
  • Discord
  • -
  • Twitter
  • -
  • Facebook
  • -
  • Google+
  • -
      +

      +
      + LinuxGSM +

      + +[![LinuxGSM](https://img.shields.io/badge/-LinuxGSM-2b2b2b.svg?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAACsAAABACAYAAACDbo5ZAAAGD0lEQVR4AcWYa2wUVRvHz75c2vJ2disXoUBEVIioRAx%2BMIFA1IRwUS6KCCiIKBrvhEYiiGm5iBgk8QOGEgUUDYTttmVZWFr2UmwURS6iYAoCtmisElSsdHdbkT7%2BTzoNy%2BGc2dm54C%2F5Rdkz85x%2FZ86ZOXOYXYhIg3Phx%2FA4PAcv6f%2Btg5vhHJjP3EcZsgsshufJHH%2FAJbDztQ7aG35J1vgCXn%2BtgvrgEbLHYei9FmE3kDOUuh10OGwjZ7gEh7kZ9gNyllK3gnrg7%2BQs56DHjbCDyB0GuRF2ArnDeDfCziF3mO1G2FfJHRa4EXYpuUOxG2GXkzuUuBH2TXKH5W6ELSV3eM%2BNsOUk5yQcAY8p2uvgSPitor3MjbB1UOQXOFBvHwpbhPYWOExvL4SNUOQ7p4P2JTlzhOPmCu0vCu1PQpE2WOhk2MdJjk9y7HNwP1wEPUJbAcmZ6WTYrYolnifbxZBiibnFySHQCkUaLdY7C0V4%2FT5OhF1JcuIW6%2B0lOcvsBi2Ezao3j8Ov7Quwj52w60jNKIs1R5GatVaDDoEXSU4D7GSxbidYT3IuwjusFK0mNUVMwaZNNbl%2B%2F87hoVCom0HthaQmnG3QB0lNPcxlCvz%2B0GtlZTuorCxYYlA%2FDzbY%2FnrAgV3hCVLzCDMgEAi9wMMi9IIM%2FUwnNXWwi5mwRaSmmmXA798xq%2F3Khp420VeE1LyS6eQeBhttSXgzywCCToIUCOyYZvKLOWWwkdfd6ORVpGYJM0F5efDe9mEQHGty2BWTmhVGO4PNBmOoKzMBxmo%2FhD25dWvljSbD5hjMkb9gT9lJq63Mzi1bKkbjloc7xBWtwiRrDASCVRi%2FRxA8if%2BvrawMTzYI%2FACpeUv2KFFtDcUyTKilCHcis8G1Ga7wHpLzG8wVFs1K7jaeUKHZfIxmkj9%2FM4S9x9RGiMEudo0QbCVu9Xqn5PWEwLUk5%2FP0iaXac53I0kAH9Sau4m54lo%2FdTMfyekLYKQZ7ub34AbMMlmw5irC2VYTN0fuVMYMf8JHxJ7L7YYXAlSRnI2%2F8RtH4siTsDMz%2BZ5yS15OEXUxyDjGD1%2BvEq8MG16CDzY6JepKwT6geYbzxb0XjGMl7vwGSgzZIwo4nOa1M8Yr9Afb%2Fj8L21%2FsXaeaNZ2A6KTiEASph%2F0vF80cn4tokqu79fzfCUk2vfF4%2FFdFGEjGPHvg2yWrsDG%2F4%2BqpZB8jPOiXjWk0y5iXdM3XhKUvxBTA9UvHuvNPh%2Bzb%2BWj10z6nwuHWBbQFMvNCjKnn7qd1jS%2Fnx9VX3b6jC%2BbwOr5eMe3%2B83IcW4%2F3qgT%2BUTbA9srGaiHsn8AKiF6Ld%2FxF%2FOx6eeAJXabvK78MTTornNMd6XJTVR7%2Fj9bBjhFxV%2FMc1kJOAy2AeA%2FgrV4mFVDZFCqm8rEJ6qysCAWqK9iaztRJRbWXa4moFTELOav7jY%2FqAvoXp0Gc9NX7bIZl17%2FZl0rC1wRLeno0NvP%2B0CTcYNnS8wW6CtzNANaxzKqo9hRNOQ8rGo7tmSsMe2zWdt2frqVRcm5s2fofCgawDNHRNxnyfqgsYez4y4ADCjRM9H73hsNWafILTQdaFiSTj%2BQ%2FxA6yH7d%2BCmR8XbYr0a7VTF2N4siSsb5qdos3R6%2FjGxpULFfw7EfORnbrI9TAToX0sD40%2F2ylcGdh2Rdhg%2BSf2gka9jRTqK9%2BGwgHz7RTfVbHxirDhivdthYUvMRX8aYAD9lstvi%2B0aDL2DUZ0eCBUNNVG0IP65FLTWqPdiqdC0koHTVXe7iyNRG23QotBEy1RbTAzQyrmnYUT2rLsoA13JpcB4eVC2daBM1g2JGLekmwf5On7EJfngfZTNnVSce8bFjaTmQdvs%2FXmO%2FJVpoXdx3RSUe9O00Fj3nUdy0RLgRHiHXOPGW1h2uKZ07c9rG%2Bxyefp23pQeyBIEQoavYlakrG8fnrY5yHn2fbxXzAgw7m8bT5zkkSk4C7cpmOK21esB%2FXAQ5DzFfTo43%2BF%2FDzf0eZ4wZ3MDSjMcvD6nIeOahGgia%2FyU3HforTPkWkwnakdn0cI9jqfbPjD%2FuQLJr6644snlgX%2FApOMoyd1R5%2FxAAAAAElFTkSuQmCC)](https://linuxgsm.com) [![Build Status](https://travis-ci.com/GameServerManagers/LinuxGSM.svg?branch=master)](https://travis-ci.com/GameServerManagers/LinuxGSM) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/3e98be27840043a090c3ab6e35db44b0)](https://app.codacy.com/app/GameServerManagers/LinuxGSM?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Grade_Dashboard) [![Discord](https://discordapp.com/api/guilds/127498813903601664/widget.png?style=shield)](https://linuxgsm.com/discord) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE) [![made-with-bash](https://img.shields.io/badge/-Made%20with%20Bash-1f425f.svg?logo=image%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkE3MDg2QTAyQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkE3MDg2QTAzQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTcwODZBMDBBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTcwODZBMDFBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciLz4gPC9yZGY6RGVzY3JpcHRpb24%2BIDwvcmRmOlJERj4gPC94OnhtcG1ldGE%2BIDw%2FeHBhY2tldCBlbmQ9InIiPz6lm45hAAADkklEQVR42qyVa0yTVxzGn7d9Wy03MS2ii8s%2BeokYNQSVhCzOjXZOFNF4jx%2BMRmPUMEUEqVG36jo2thizLSQSMd4N8ZoQ8RKjJtooaCpK6ZoCtRXKpRempbTv5ey83bhkAUphz8fznvP8znn%2B%2F3NeEEJgNBoRRSmz0ub%2FfuxEacBg%2FDmYtiCjgo5NG2mBXq%2BH5I1ogMRk9Zbd%2BQU2e1ML6VPLOyf5tvBQ8yT1lG10imxsABm7SLs898GTpyYynEzP60hO3trHDKvMigUwdeaceacqzp7nOI4n0SSIIjl36ao4Z356OV07fSQAk6xJ3XGg%2BLCr1d1OYlVHp4eUHPnerU79ZA%2F1kuv1JQMAg%2BE4O2P23EumF3VkvHprsZKMzKwbRUXFEyTvSIEmTVbrysp%2BWr8wfQHGK6WChVa3bKUmdWou%2BjpArdGkzZ41c1zG%2Fu5uGH4swzd561F%2BuhIT4%2BLnSuPsv9%2BJKIpjNr9dXYOyk7%2FBZrcjIT4eCnoKgedJP4BEqhG77E3NKP31FO7cfQA5K0dSYuLgz2TwCWJSOBzG6crzKK%2BohNfni%2Bx6OMUMMNe%2Fgf7ocbw0v0acKg6J8Ql0q%2BT%2FAXR5PNi5dz9c71upuQqCKFAD%2BYhrZLEAmpodaHO3Qy6TI3NhBpbrshGtOWKOSMYwYGQM8nJzoFJNxP2HjyIQho4PewK6hBktoDcUwtIln4PjOWzflQ%2Be5yl0yCCYgYikTclGlxadio%2BBQCSiW1UXoVGrKYwH4RgMrjU1HAB4vR6LzWYfFUCKxfS8Ftk5qxHoCUQAUkRJaSEokkV6Y%2F%2BJUOC4hn6A39NVXVBYeNP8piH6HeA4fPbpdBQV5KOx0QaL1YppX3Jgk0TwH2Vg6S3u%2BdB91%2B%2FpuNYPYFl5uP5V7ZqvsrX7jxqMXR6ff3gCQSTzFI0a1TX3wIs8ul%2Bq4HuWAAiM39vhOuR1O1fQ2gT%2F26Z8Z5vrl2OHi9OXZn995nLV9aFfS6UC9JeJPfuK0NBohWpCHMSAAsFe74WWP%2BvT25wtP9Bpob6uGqqyDnOtaeumjRu%2ByFu36VntK%2FPA5umTJeUtPWZSU9BCgud661odVp3DZtkc7AnYR33RRC708PrVi1larW7XwZIjLnd7R6SgSqWSNjU1B3F72pz5TZbXmX5vV81Yb7Lg7XT%2FUXriu8XLVqw6c6XqWnBKiiYU%2BMt3wWF7u7i91XlSEITwSAZ%2FCzAAHsJVbwXYFFEAAAAASUVORK5CYII%3D)](https://www.gnu.org/software/bash/) [![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors) + +[LinuxGSM](https://linuxgsm.com) is the command line tool for quick, simple deployment and management of dedicated game servers. + +## Hassle-Free Dedicated Game Servers + +Traditionally game servers are not easy to manage yourself. Admins often have to spend hours just messing around trying to get their server working. LinuxGSM is designed to be as simple as possible allowing admins to spend less time on management and more time gaming. + +## Main features + +80+ game servers supported + +* :truck: Installer +* :mag: Monitor +* :phone: Alerts +* :cloud: Updater +* :blue_book: Server Details +* :floppy_disk: Backup +* :computer: Console + +## :penguin: Compatibility + +Linux Game Server Managers are tested to work on the following Linux distros. + +* Debian based (Ubuntu, Mint etc.) +* Red Hat based (CentOS, Fedora etc.) + +Other distros are likely to work but are not fully tested. + +## :wrench: Requirements + +Each game server has its own specific dependency requirements, but most require GLIBC and Tmux. Visit the specific game server installation page on the [LinuxGSM](https://linuxgsm.com) website to see dependencies. + +* [GLIBC](https://docs.linuxgsm.com/requirements/glibc) >= 2.15 recommended [[specific requirements]](https://docs.linuxgsm.com/requirements/glibc#server-requirements) +* [Tmux](https://docs.linuxgsm.com/requirements/tmux) >= 1.6 recommended (Avoid Tmux 1.8) + +## :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 [PayPal](https://www.paypal.me/dgibbs64), [Patreon](https://www.patreon.com/dgibbs) and [Flattr](https://flattr.com/@dgibbs). I would like to thank everyone who has previously sent a donation. LinuxGSM has been going since 2012 and I have spent 1000s of hours developing and improving the project and continue to regularly add support for new servers. + +## Contributors + +Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + +
      Daniel Gibbs
      Daniel Gibbs

      🐛 💻 🤔 💬 👀 🖋 📖 🚇
      Frisasky
      Frisasky

      💬 🐛 💻
      Kenny Lindelof
      Kenny Lindelof

      💬
      Austin Shapiro
      Austin Shapiro

      🐛 💻
      Marvin Lehmann
      Marvin Lehmann

      🐛 💻
      Bourne-ID
      Bourne-ID

      👀 🖋 📖 🚇 👀
      CedarLUG
      CedarLUG

      🐛 💻 🤔 💬 👀
      UltimateByte
      UltimateByte

      🐛 💻 📖 🤔 👀
      Attila
      Attila

      💻 🐛
      + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! \ No newline at end of file diff --git a/RedOrchestra/roserver b/RedOrchestra/roserver deleted file mode 100644 index 85bd1b103..000000000 --- a/RedOrchestra/roserver +++ /dev/null @@ -1,208 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Red Orchestra: Ostfront 41-45 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -steamuser="username" -steampass="password" - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="RO-Arad.rom" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="server ${defaultmap}?game=ROGame.ROTeamGame?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="223250" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Red Orchestra: Ostfront 41-45" -engine="unreal2" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ro-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" - -## Server Specific Directories -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/system" -executabledir="${systemdir}" -executable="./ucc-bin" -servercfg="${servicename}.ini" -servercfgdefault="default.ini" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -compressedmapsdir="${rootdir}/Maps-Compressed" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" -gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/Ricochet/ricochetserver b/Ricochet/ricochetserver deleted file mode 100644 index aaaf3f761..000000000 --- a/Ricochet/ricochetserver +++ /dev/null @@ -1,225 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Ricochet | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -# Start Variables -defaultmap="rc_arena" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -steamuser="username" -steampass="password" - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -ip="0.0.0.0" - -## Optional: Game Server Login Token -# GSLT can be used for running a public server. -# More info: https://gameservermanagers.com/gslt -gslt="" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="90" -appidmod="ricochet" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Ricochet" -engine="goldsource" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ricochet-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/ricochet" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/Rust/rustserver b/Rust/rustserver deleted file mode 100644 index f02e29231..000000000 --- a/Rust/rustserver +++ /dev/null @@ -1,219 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Rust | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -# More settings available after install in serverfiles/server/rust-server/server.cfg -servername="Rust" -ip="0.0.0.0" -port="28015" -rconport="28016" -rconpassword="CHANGE_ME" -maxplayers="50" -# Advanced Start Settings -seed="" # default random; range : 1 to 2147483647 ; used to change or reproduce a procedural map -worldsize="3000" # default 3000; range : 1000 to 6000 ; map size in meters -saveinterval="300" # Auto-save in seconds -tickrate="30" # default 30; range : 15 to 100 - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | https://developer.valvesoftware.com/wiki/Rust_Dedicated_Server -fn_parms(){ -parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${servicename}\" ${conditionalseed} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile ${gamelogfile}" -} - -# Specific to Rust -if [ -n "${seed}" ]; then - # If set, then add to start parms - conditionalseed="+server.seed ${seed}" -else - # Keep randomness of the number if not set - conditionalseed="" -fi - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="258550" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Rust" -engine="unity3d" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="rust-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./RustDedicated" -serveridentitydir="${systemdir}/server/${servicename}" -servercfg="server.cfg" -servercfgdefault="server.cfg" -servercfgdir="${serveridentitydir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" -gamelogfile="\"gamelog-$(date '+%Y-%m-%d-%H-%M-%S').log\"" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh diff --git a/SeriousSam3BFE/ss3sserver b/SeriousSam3BFE/ss3sserver deleted file mode 100644 index f668959d6..000000000 --- a/SeriousSam3BFE/ss3sserver +++ /dev/null @@ -1,198 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Sam 3: BFE | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master/SeriousSam3BFE/help/DedicatedServer_Readme.txt -fn_parms(){ -parms="+ip ${ip} +logfile ${gamelog} +exec ${servercfgfullpath}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="41080" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Serious Sam 3: BFE" -engine="seriousengine35" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ss3-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/Bin" -executable="./runSam3_DedicatedServer.sh" -executabledir="${systemdir}" -servercfg="${servicename}.ini" -servercfgdefault="server.ini" -servercfgdir="${filesdir}/Content/SeriousSam3/Config" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" -gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/Starbound/sbserver b/Starbound/sbserver deleted file mode 100644 index d4d93913f..000000000 --- a/Starbound/sbserver +++ /dev/null @@ -1,200 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Starbound | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -steamuser="username" -steampass="password" - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="211820" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Starbound" -engine="starbound" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="sb-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}/linux" -executable="./starbound_server" -servercfg="starbound_server.config" -servercfgdefault="starbound_server.config" -servercfgdir="${filesdir}/storage" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${filesdir}/storage" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/SvenCoop/svenserver b/SvenCoop/svenserver deleted file mode 100644 index c69706307..000000000 --- a/SvenCoop/svenserver +++ /dev/null @@ -1,200 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Sven Co-op | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="svencoop1" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 -fn_parms(){ -parms="-game svencoop -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="276060" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Sven Co-op" -engine="goldsource" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="svencoop-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/svencoop" -executabledir="${filesdir}" -executable="./svends_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/TeamFortress2/tf2server b/TeamFortress2/tf2server deleted file mode 100644 index c4ae5feae..000000000 --- a/TeamFortress2/tf2server +++ /dev/null @@ -1,204 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Team Fortress 2 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="cp_badlands" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" - -## Optional: Game Server Login Token -# GSLT can be used for running a public server. -# More info: https://gameservermanagers.com/gslt -gslt="" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="232250" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Team Fortress 2" -engine="source" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="tf2-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/tf" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/TeamFortressClassic/tfcserver b/TeamFortressClassic/tfcserver deleted file mode 100644 index 68be7bfb0..000000000 --- a/TeamFortressClassic/tfcserver +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Team Fortress Classic | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="dustbowl" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | 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}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="90" -appidmod="tfc" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Team Fortress Classic" -engine="goldsource" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="tfc-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/tfc" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/TeamSpeak3/ts3server b/TeamSpeak3/ts3server deleted file mode 100644 index b22971108..000000000 --- a/TeamSpeak3/ts3server +++ /dev/null @@ -1,177 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: TeamSpeak 3 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -# Edit serverfiles/ts3-server.ini after installation - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="TeamSpeak 3" -servername="TeamSpeak 3 Server" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ts3-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./ts3server_startscript.sh" -servercfg="${servicename}.ini" -servercfgdefault="ts3server.ini" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${filesdir}/logs" -scriptlogdir="${rootdir}/log/script" -scriptlog="${scriptlogdir}/${servicename}-script.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/Teeworlds/twserver b/Teeworlds/twserver deleted file mode 100644 index 367baa386..000000000 --- a/Teeworlds/twserver +++ /dev/null @@ -1,201 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Teeworlds | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -steamuser="username" -steampass="password" - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="-f ${servercfgfullpath}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="380840" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Teeworlds" -engine="teeworlds" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="tw-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -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 -servercfgdefault="server.cfg" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/Terraria/terrariaserver b/Terraria/terrariaserver deleted file mode 100644 index cc68d2632..000000000 --- a/Terraria/terrariaserver +++ /dev/null @@ -1,200 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Terraria | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -steamuser="username" -steampass="password" - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="-config ${servercfgfullpath}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="105600" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Terraria" -engine="terraria" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="terraria-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./TerrariaServer" -servercfg="${servicename}.txt" -servercfgdefault="serverconfig.txt" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -#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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/UnrealTournament/utserver b/UnrealTournament/utserver deleted file mode 100644 index 23a0d0ff1..000000000 --- a/UnrealTournament/utserver +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Unreal Tournament | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -# For CTF: defaultmap="CTF-Face" gametype="CTF" -defaultmap="DM-Underland" -gametype="DM" -timelimit="10" -ip="0.0.0.0" -port="7777" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="UnrealTournament ${defaultmap}?Game=${gametype}?TimeLimit=${timelimit} -port=${port}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Unreal Tournament" -engine="unreal4" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ut-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/LinuxServer" -executabledir="${systemdir}/Engine/Binaries/Linux" -executable="./UE4Server-Linux-Shipping" -servercfg="Game.ini" -servercfgdir="${systemdir}/UnrealTournament/Saved/Config/LinuxServer" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${filesdir}/Logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/UnrealTournament2004/ut2k4server b/UnrealTournament2004/ut2k4server deleted file mode 100644 index 2ee0f9b3f..000000000 --- a/UnrealTournament2004/ut2k4server +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Unreal Tournament 2004 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="DM-Rankin" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | -fn_parms(){ -parms="server ${defaultmap}?game=XGame.xDeathMatch -nohomedir ini=${servercfg} log=${gamelog}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Unreal Tournament 2004" -engine="unreal2" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ut2k4-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/System" -executabledir="${systemdir}" -executable="./ucc-bin" -servercfg="${servicename}.ini" -servercfgdefault="UT2004.ini" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -compressedmapsdir="${rootdir}/Maps-Compressed" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" -gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/UnrealTournament3/ut3server b/UnrealTournament3/ut3server deleted file mode 100644 index f721859b0..000000000 --- a/UnrealTournament3/ut3server +++ /dev/null @@ -1,199 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Unreal Tournament 3 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -ip="0.0.0.0" -port="7777" -queryport="25300" -defaultmap="VCTF-Suspense" -game="UTGameContent.UTVehicleCTFGame_Content" -mutators="" #"UTGame.UTMutator_Instagib,UTGame.UTMutator_LowGrav" -isdedicated="true" -islanmatch="false" -usesstats="false" -shouldadvertise="true" -pureserver="1" -allowjoininprogress="true" -maxplayers="32" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care | List of game types and mutators : http://wiki.unrealadmin.org/FAQ:UT3 -fn_parms(){ -parms="server ${defaultmap}?Game=${game}?bIsDedicated=${isdedicated}?bIsLanMatch=${islanmatch}?bUsesStats=${usesstats}?bShouldAdvertise=${shouldadvertise}?PureServer=${pureserver}?bAllowJoinInProgress=${allowjoininprogress}?MaxPlayers=${maxplayers}?Mutator=${mutators} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Unreal Tournament 3" -engine="unreal3" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ut3-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${systemdir}/Binaries" -executable="./ut3" -servercfg="${servicename}.ini" -servercfgdefault="UTGame.ini" -servercfgdir="${systemdir}/UTGame/Config" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" -gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/UnrealTournament99/ut99server b/UnrealTournament99/ut99server deleted file mode 100644 index 8a86a4bfb..000000000 --- a/UnrealTournament99/ut99server +++ /dev/null @@ -1,187 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Unreal Tournament 99 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -defaultmap="DM-Deck16][" -ip="0.0.0.0" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="server ${defaultmap}.unr ini=${servercfgfullpath}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Unreal Tournament 99" -engine="unreal" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="ut99-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}/System" -executabledir="${systemdir}" -executable="./ucc-bin" -servercfg="${servicename}.ini" -servercfgdefault="Default.ini" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -compressedmapsdir="${rootdir}/Maps-Compressed" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${filesdir}/Logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file diff --git a/WolfensteinEnemyTerritory/wetserver b/WolfensteinEnemyTerritory/wetserver deleted file mode 100644 index 7cddd0575..000000000 --- a/WolfensteinEnemyTerritory/wetserver +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: Enemy Territory | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="161125" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -# Please use Enemy Territory config file. - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care -fn_parms(){ - parms="+set net_strict 1 +set fs_homepath ${filesdir} +exec ${servercfg}" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Wolfenstein: Enemy Territory" -engine="idtech3" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="et-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${systemdir}" -executable="./etded" -servercfg="${servicename}.cfg" -servercfgdefault="server.cfg" -servercfgdir="${systemdir}/etmain" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${filesdir}/Logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh \ No newline at end of file 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-250x130-dark.png b/images/logo/lgsm-250x130-dark.png deleted file mode 100644 index 2490a4fde..000000000 Binary files a/images/logo/lgsm-250x130-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/DST_menu.png b/images/screens/DST_menu.png deleted file mode 100644 index 5b307f5aa..000000000 Binary files a/images/screens/DST_menu.png and /dev/null differ diff --git a/images/screens/DST_title.png b/images/screens/DST_title.png deleted file mode 100644 index b189898f9..000000000 Binary files a/images/screens/DST_title.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/images/screens/steamcmd.png b/images/screens/steamcmd.png deleted file mode 100644 index d22b76505..000000000 Binary files a/images/screens/steamcmd.png and /dev/null differ diff --git a/images/screens/steamguard.jpg b/images/screens/steamguard.jpg deleted file mode 100644 index db93381ff..000000000 Binary files a/images/screens/steamguard.jpg and /dev/null differ 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..728a9f68a --- /dev/null +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -0,0 +1,142 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +queryport="27015" +rconport="27020" +# Default Map: TheIsland, Ragnarok, CrystalIsles, Aberration_P, ScorchedEarth_P +defaultmap="TheIsland" +maxplayers="70" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="\"${defaultmap}?AltSaveDirectoryName=${defaultmap}?listen?MultiHome=${ip}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port} -automanagedmods\"" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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="5" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="376030" +# 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="ARK: Survival Evolved" +engine="unreal4" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific 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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/arma3server/_default.cfg b/lgsm/config-default/config-lgsm/arma3server/_default.cfg new file mode 100644 index 000000000..828bbdd04 --- /dev/null +++ b/lgsm/config-default/config-lgsm/arma3server/_default.cfg @@ -0,0 +1,158 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## 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="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 Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods} -servermod=${servermods} -bepath=${bepath} -autoinit -loadmissiontomemory" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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="5" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="233780" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="ARMA 3" +engine="realvirtuality" +glibc="2.13" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./arma3server" +servercfg="${servicename}.server.cfg" +networkcfg="${servicename}.network.cfg" +servercfgdefault="server.cfg" +networkcfgdefault="network.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +networkcfgfullpath="${servercfgdir}/${networkcfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/bb2server/_default.cfg b/lgsm/config-default/config-lgsm/bb2server/_default.cfg new file mode 100644 index 000000000..80e1244f9 --- /dev/null +++ b/lgsm/config-default/config-lgsm/bb2server/_default.cfg @@ -0,0 +1,146 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="bba_barracks" +maxplayers="20" + +## Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://linuxgsm.com/gslt +gslt="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game brainbread2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="475370" +# 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="BrainBread 2" +engine="source" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/brainbread2" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/bbserver/_default.cfg b/lgsm/config-default/config-lgsm/bbserver/_default.cfg new file mode 100644 index 000000000..2a89c8849 --- /dev/null +++ b/lgsm/config-default/config-lgsm/bbserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="bb_chp4_slaywatch" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game brainbread -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="90" +appidmod="cstrike" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="BrainBread" +engine="goldsource" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/brainbread" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/bdserver/_default.cfg b/lgsm/config-default/config-lgsm/bdserver/_default.cfg new file mode 100644 index 000000000..5e030759c --- /dev/null +++ b/lgsm/config-default/config-lgsm/bdserver/_default.cfg @@ -0,0 +1,140 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="pve_tomb" +maxplayers="3" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game bdef -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="817300" +# 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="Base Defense" +engine="goldsource" +glibc="2.14" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/bdef" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg new file mode 100644 index 000000000..c1193658f --- /dev/null +++ b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg @@ -0,0 +1,125 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="+hostServer 1 +dedicated 1" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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" + +## LinuxGSM Server Details +# Do not edit +gamename="Battlefield: 1942" +engine="refractor" +glibc="2.0" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./start.sh" +servercfg="serversettings.con" +servercfgdefault="serversettings.con" +servercfgdir="${systemdir}/mods/bf1942/settings" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg new file mode 100644 index 000000000..f2d27f8b5 --- /dev/null +++ b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg @@ -0,0 +1,146 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="dm_bounce" +maxplayers="16" + +## Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://linuxgsm.com/gslt +gslt="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game bms -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="346680" +# 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="Black Mesa: Deathmatch" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/bms" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/boserver/_default.cfg b/lgsm/config-default/config-lgsm/boserver/_default.cfg new file mode 100644 index 000000000..1793f6bd5 --- /dev/null +++ b/lgsm/config-default/config-lgsm/boserver/_default.cfg @@ -0,0 +1,139 @@ +################################## +######## 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 #### + +## Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://linuxgsm.com/gslt +gslt="" +ip="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-batchmode -nographics -dedicated -configfile=${servercfgfullpath}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="416880" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Ballistic Overkill" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./BODS.x86" +servercfg="${servicename}.txt" +servercfgdefault="config.txt" +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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/bsserver/_default.cfg b/lgsm/config-default/config-lgsm/bsserver/_default.cfg new file mode 100644 index 000000000..08823a4bc --- /dev/null +++ b/lgsm/config-default/config-lgsm/bsserver/_default.cfg @@ -0,0 +1,150 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="duel_winter" +maxplayers="16" + +## Required: Game Server Login Token +# GSLT is required for running a public server. +# More info: https://linuxgsm.com/gslt +gslt="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game "${serverfiles}/berimbau" -autoupdate -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="228780" +# 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="Blade Symphony" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/berimbau" +executabledir="${serverfiles}/bin" +executable="./srcds_run.sh" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/bt1944server/_default.cfg b/lgsm/config-default/config-lgsm/bt1944server/_default.cfg new file mode 100644 index 000000000..2176236c5 --- /dev/null +++ b/lgsm/config-default/config-lgsm/bt1944server/_default.cfg @@ -0,0 +1,138 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +queryport="7780" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="/Game/Maps/Final_Maps/Derailed?Game=/Script/ShooterGame.BombGameMode?listen -log -broadcastip=\"${ip}\" -PORT=${port} -QueryPort=${queryport} -defgameini=\"${servercfgfullpath}\"" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="805140" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Battalion 1944" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/Linux/Battalion" +executabledir="${systemdir}/Binaries/Linux" +executable="./BattalionServer" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ccserver/_default.cfg b/lgsm/config-default/config-lgsm/ccserver/_default.cfg new file mode 100644 index 000000000..65d36f1b2 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ccserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="cbe_bunker" +maxplayers="6" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game cure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="383410" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Codename CURE" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/cure" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/cod2server/_default.cfg b/lgsm/config-default/config-lgsm/cod2server/_default.cfg new file mode 100644 index 000000000..8f4602123 --- /dev/null +++ b/lgsm/config-default/config-lgsm/cod2server/_default.cfg @@ -0,0 +1,128 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="28960" +defaultmap="mp_leningrad" +maxplayers="20" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Call of Duty 2" +engine="iw2.0" +glibc="2.1.3" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./cod2_lnxded" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/main" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/cod4server/_default.cfg b/lgsm/config-default/config-lgsm/cod4server/_default.cfg new file mode 100644 index 000000000..6ef656494 --- /dev/null +++ b/lgsm/config-default/config-lgsm/cod4server/_default.cfg @@ -0,0 +1,128 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="28960" +defaultmap="mp_crossfire" +maxplayers="32" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set fs_homepath ${serverfiles} +set sv_authorizemode "-1" +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Call of Duty 4" +engine="iw3.0" +glibc="2.3" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./cod4x18_dedrun" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/main" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/codserver/_default.cfg b/lgsm/config-default/config-lgsm/codserver/_default.cfg new file mode 100644 index 000000000..7c6cd2e35 --- /dev/null +++ b/lgsm/config-default/config-lgsm/codserver/_default.cfg @@ -0,0 +1,128 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="28960" +defaultmap="mp_neuville" +maxplayers="20" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Call of Duty" +engine="idtech3" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./cod_lnxded" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/main" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg new file mode 100644 index 000000000..3a61761c5 --- /dev/null +++ b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg @@ -0,0 +1,128 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="28960" +defaultmap="mp_cassino" +maxplayers="20" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Call of Duty: United Offensive" +engine="idtech3" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./coduo_lnxded" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/uo" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg new file mode 100644 index 000000000..1610ab01f --- /dev/null +++ b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg @@ -0,0 +1,128 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="28960" +defaultmap="mp_castle" +maxplayers="20" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Call of Duty: World at War" +engine="iw3.0" +glibc="2.3.2" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./codwaw_lnxded" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/main" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/common-template.cfg b/lgsm/config-default/config-lgsm/common-template.cfg new file mode 100644 index 000000000..ddb1ef233 --- /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..eb85d04ce --- /dev/null +++ b/lgsm/config-default/config-lgsm/csczserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="de_dust2" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game czero -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="90" +appidmod="czero" +# 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="Counter-Strike: Condition Zero" +engine="goldsource" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/czero" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg new file mode 100644 index 000000000..5dac93530 --- /dev/null +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -0,0 +1,166 @@ +################################## +######## 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 +# https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server +# [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" + +## Required: Game Server Login Token +# GSLT is required for running a public server. +# More info: https://linuxgsm.com/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 Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_type ${gametype} +game_mode ${gamemode} +host_workshop_collection ${wscollectionid} +workshop_start_map ${wsstartmap} -authkey ${wsapikey} -nobreakpad" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="740" +# 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="Counter-Strike: Global Offensive" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/csgo" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/csserver/_default.cfg b/lgsm/config-default/config-lgsm/csserver/_default.cfg new file mode 100644 index 000000000..60390eb68 --- /dev/null +++ b/lgsm/config-default/config-lgsm/csserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="de_dust2" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game cstrike -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="90" +appidmod="cstrike" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## LinuxGSM Server Details +# Do not edit +gamename="Counter-Strike 1.6" +engine="goldsource" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/cstrike" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/cssserver/_default.cfg b/lgsm/config-default/config-lgsm/cssserver/_default.cfg new file mode 100644 index 000000000..e07733c32 --- /dev/null +++ b/lgsm/config-default/config-lgsm/cssserver/_default.cfg @@ -0,0 +1,146 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="de_dust2" +maxplayers="16" + +## Required: Game Server Login Token +# GSLT is required for running a public server. +# More info: https://linuxgsm.com/gslt +gslt="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="232330" +# 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="Counter-Strike: Source" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/cstrike" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/dabserver/_default.cfg b/lgsm/config-default/config-lgsm/dabserver/_default.cfg new file mode 100644 index 000000000..e65d5cb94 --- /dev/null +++ b/lgsm/config-default/config-lgsm/dabserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="da_rooftops" +maxplayers="10" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="317800" +# 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="Double Action: Boogaloo" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/dab" +executabledir="${serverfiles}" +executable="./dabds.sh" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg new file mode 100644 index 000000000..804cb020c --- /dev/null +++ b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="dcdm5" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game dmc -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="90" +appidmod="dmc" +# 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="Deathmatch Classic" +engine="goldsource" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/dmc" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/dodserver/_default.cfg b/lgsm/config-default/config-lgsm/dodserver/_default.cfg new file mode 100644 index 000000000..e82012e29 --- /dev/null +++ b/lgsm/config-default/config-lgsm/dodserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="dod_Anzio" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game dod -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="90" +appidmod="dod" +# 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="Day of Defeat" +engine="goldsource" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/dod" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg new file mode 100644 index 000000000..4ce487dbc --- /dev/null +++ b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="dod_Anzio" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game dod -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="232290" +# 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="Day of Defeat: Source" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/dod" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/doiserver/_default.cfg b/lgsm/config-default/config-lgsm/doiserver/_default.cfg new file mode 100644 index 000000000..1b8f16916 --- /dev/null +++ b/lgsm/config-default/config-lgsm/doiserver/_default.cfg @@ -0,0 +1,142 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="bastogne" +maxplayers="16" +tickrate="64" +workshop="0" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game doi -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} +sv_workshop_enabled ${workshop}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="462310" +# 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="Day of Infamy" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/doi" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/dstserver/_default.cfg b/lgsm/config-default/config-lgsm/dstserver/_default.cfg new file mode 100644 index 000000000..70bc1e1bc --- /dev/null +++ b/lgsm/config-default/config-lgsm/dstserver/_default.cfg @@ -0,0 +1,151 @@ +################################## +######## 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 #### + +## Installation Variables | https://docs.linuxgsm.com/game-servers/dont-starve-together +sharding="false" +master="true" +shard="Master" +cluster="Cluster_1" +cave="false" + +# Edit with care +persistentstorageroot="${HOME}/.klei" +confdir="DoNotStarveTogether" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-persistent_storage_root ${persistentstorageroot} -conf_dir ${confdir} -cluster ${cluster} -shard ${shard}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="343050" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Don't Starve Together" +engine="dontstarve" +glibc="2.15" + +## Service Name | https://docs.linuxgsm.com/features/multiple-game-servers +servicename="dst-server-${shard}" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}/bin" +executable="./dontstarve_dedicated_server_nullrenderer" +clustercfg="cluster.ini" +clustercfgdir="${persistentstorageroot}/${confdir}/${cluster}" +clustercfgfullpath="${clustercfgdir}/${clustercfg}" +clustercfgdefault="cluster.ini" +servercfg="server.ini" +servercfgdir="${clustercfgdir}/${shard}" +servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="server.ini" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/dysserver/_default.cfg b/lgsm/config-default/config-lgsm/dysserver/_default.cfg new file mode 100644 index 000000000..554bc1ee6 --- /dev/null +++ b/lgsm/config-default/config-lgsm/dysserver/_default.cfg @@ -0,0 +1,146 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="dys_broadcast" +maxplayers="16" + +## Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://linuxgsm.com/gslt +gslt="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game "${serverfiles}/dystopia" -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="17585" +# 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="Dystopia" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/dystopia" +executabledir="${serverfiles}/bin" +executable="./srcds_run.sh" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg new file mode 100644 index 000000000..b08ddd850 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg @@ -0,0 +1,130 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ + parms="-nogui" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="739590" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Eco" +engine="unity3d" +glibc="null" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="mono ./EcoServer.exe" +servercfg="Network.eco" +servercfgdefault="Network.eco" +servercfgdir="${systemdir}/Configs" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" +gamelogdate="${gamelogdir}/${servicename}-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..5b9efc6de --- /dev/null +++ b/lgsm/config-default/config-lgsm/emserver/_default.cfg @@ -0,0 +1,146 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="emp_district" +maxplayers="62" + +## Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://linuxgsm.com/gslt +gslt="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game empires -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="460040" +# 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="Empires Mod" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/empires" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/etlserver/_default.cfg b/lgsm/config-default/config-lgsm/etlserver/_default.cfg new file mode 100644 index 000000000..9033c8fcf --- /dev/null +++ b/lgsm/config-default/config-lgsm/etlserver/_default.cfg @@ -0,0 +1,122 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ + parms="+set net_strict 1 +set fs_homepath ${serverfiles} +exec ${servercfg}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="ET: Legacy" +engine="idtech3" +glibc="2.7" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./etlded" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/etmain" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg new file mode 100644 index 000000000..59fdd7b8f --- /dev/null +++ b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg @@ -0,0 +1,132 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="34197" +rconport="34198" +rconpassword="CHANGE_ME" +# (stable|experimental) +branch="stable" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="--start-server ${serverfiles}/save1.zip --server-settings ${servercfgfullpath} --port ${port} --rcon-port ${rconport} --rcon-password ${rconpassword}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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" + +## LinuxGSM Server Details +# Do not edit +gamename="Factorio" +engine="factorio" +glibc="2.18" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}/bin/x64" +executable="./factorio" +servercfg="${servicename}.json" +servercfgdefault="server-settings.json" +servercfgdir="${serverfiles}/data" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +gamelogdir="${serverfiles}" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/fofserver/_default.cfg b/lgsm/config-default/config-lgsm/fofserver/_default.cfg new file mode 100644 index 000000000..692bce2bb --- /dev/null +++ b/lgsm/config-default/config-lgsm/fofserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="fof_depot" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game fof -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="295230" +# 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="Fistful of Frags" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/fof" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/gesserver/_default.cfg b/lgsm/config-default/config-lgsm/gesserver/_default.cfg new file mode 100644 index 000000000..4a16eacc2 --- /dev/null +++ b/lgsm/config-default/config-lgsm/gesserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="ge_archives" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game gesource -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="310" # Source 2007 SDK +# 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="GoldenEye: Source" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/gesource" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg new file mode 100644 index 000000000..7090b26aa --- /dev/null +++ b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg @@ -0,0 +1,158 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="gm_construct" +maxplayers="16" +tickrate="66" +gamemode="sandbox" + +## Workshop Parameters | https://wiki.garrysmod.com/page/Workshop_for_Dedicated_Servers +# To get an API key visit - https://steamcommunity.com/dev/apikey +wsapikey="" +wscollectionid="" + +## Custom Start Parameters +# Default -disableluarefresh, disables lua autorefresh reducing server lag. Auto refresh only useful for developers. +customparms="-disableluarefresh" + +## Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://linuxgsm.com/gslt +gslt="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} -tickrate ${tickrate} +host_workshop_collection ${wscollectionid} -authkey ${wsapikey} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers} ${customparms}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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="5" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="4020" +# 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="Garry's Mod" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/garrysmod" +addonsdir="${systemdir}/addons" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg new file mode 100644 index 000000000..15a39af24 --- /dev/null +++ b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="dm_lockdown" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game hl2mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="232370" +# 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="Half Life 2: Deathmatch" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/hl2mp" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg new file mode 100644 index 000000000..1f57e9880 --- /dev/null +++ b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg @@ -0,0 +1,140 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="crossfire" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game valve -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="90" +# 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="Half Life: Deathmatch" +engine="goldsource" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/valve" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg new file mode 100644 index 000000000..c89b5a19c --- /dev/null +++ b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="crossfire" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game hl1mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="255470" +# 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="Half-Life Deathmatch: Source" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/hl1mp" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg new file mode 100644 index 000000000..d01949784 --- /dev/null +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -0,0 +1,150 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | 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" + +## Adding admins using STEAMID64 +# Example : addadmin 012345678901234567; addadmin 987654321098765432 +admins="" + +## Advanced Server Start Settings +# Rollback server state (remove after start command) +loadsave="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Edit with care | http://hurtworld.wikia.com/wiki/Hosting_A_Server +fn_parms(){ +parms="-batchmode -nographics -exec \"host ${port} ${defaultmap} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\" -logfile \"${gamelog}\" " +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="405100" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Hurtworld" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable=$([ "$(uname -m)" == "x86_64" ] && echo "./Hurtworld.x86_64" || echo "./Hurtworld.x86") + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${servicename}-game.log" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/insserver/_default.cfg b/lgsm/config-default/config-lgsm/insserver/_default.cfg new file mode 100644 index 000000000..4e09e078b --- /dev/null +++ b/lgsm/config-default/config-lgsm/insserver/_default.cfg @@ -0,0 +1,148 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="ministry" +maxplayers="16" +tickrate="64" +workshop="0" + +## Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://linuxgsm.com/gslt +gslt="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game insurgency -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} +sv_workshop_enabled ${workshop} -norestart" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="237410" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Insurgency" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/insurgency" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg new file mode 100644 index 000000000..04ab3128c --- /dev/null +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -0,0 +1,150 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters + +ip="0.0.0.0" +port="27102" +queryport="27131" +servername="LinuxGSM Server" +serverpassword="" +defaultmap="Canyon" +defaultscenario="Scenario_Crossing_Push_Security" +maxplayers="28" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ + # Allows serverpassword to work with parameters + if [ "${serverpassword}" != "NOT SET" ]; then + parms="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers}?Port=${port}?QueryPort=${queryport}?password="${serverpassword}" -hostname='${servername}' -log" + else + parms="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers}?Port=${port}?QueryPort=${queryport} -hostname='${servername}' -log" + fi +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="581330" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Insurgency: Sandstorm" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/Insurgency" +executabledir="${systemdir}/Binaries/Linux" +executable="./InsurgencyServer-Linux-Shipping" +servercfg="Game.ini" +servercfgdefault="Game.ini" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +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}/${servicename}-game.log" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/instance-template.cfg b/lgsm/config-default/config-lgsm/instance-template.cfg new file mode 100644 index 000000000..69646e3a7 --- /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 \ No newline at end of file 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..435b8310e --- /dev/null +++ b/lgsm/config-default/config-lgsm/iosserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="8v8_vienna" +maxplayers="32" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game iosoccer -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="673990" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="IOSoccer" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/iosoccer" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/jc2server/_default.cfg b/lgsm/config-default/config-lgsm/jc2server/_default.cfg new file mode 100644 index 000000000..439adc72e --- /dev/null +++ b/lgsm/config-default/config-lgsm/jc2server/_default.cfg @@ -0,0 +1,133 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="261140" +# 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="Just Cause 2" +engine="avalanche2.0" +glibc="2.13" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./Jcmp-Server" +servercfg="config.lua" +servercfgdefault="config.lua" +servercfgdir="${serverfiles}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +#gamelogdir="" # No server logs available +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/jc3server/_default.cfg b/lgsm/config-default/config-lgsm/jc3server/_default.cfg new file mode 100644 index 000000000..a302deee0 --- /dev/null +++ b/lgsm/config-default/config-lgsm/jc3server/_default.cfg @@ -0,0 +1,133 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="619960" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Just Cause 3" +engine="avalanche3.0" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./Server" +servercfg="config.json" +servercfgdefault="config.json" +servercfgdir="${serverfiles}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +#gamelogdir="" # No server logs available +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/kf2server/_default.cfg b/lgsm/config-default/config-lgsm/kf2server/_default.cfg new file mode 100644 index 000000000..8c917fea6 --- /dev/null +++ b/lgsm/config-default/config-lgsm/kf2server/_default.cfg @@ -0,0 +1,138 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +queryport="27015" +defaultmap="KF-BioticsLab" +gamemode="KFGameContent.KFGameInfo_VersusSurvival" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="\"${defaultmap}?Game=${gamemode}?ConfigSubDir=${servicename} -QueryPort=${queryport}\"" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="232130" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Killing Floor 2" +engine="unreal3" +glibc="2.3.2" + +#### Directories #### +# Edit with care +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${systemdir}/Binaries/Win64" +executable="./KFGameSteamServer.bin.x86_64" +servercfgdir="${systemdir}/KFGame/Config/${servicename}" +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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/kfserver/_default.cfg b/lgsm/config-default/config-lgsm/kfserver/_default.cfg new file mode 100644 index 000000000..b182c60b5 --- /dev/null +++ b/lgsm/config-default/config-lgsm/kfserver/_default.cfg @@ -0,0 +1,149 @@ +################################## +######## 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" +defaultmap="KF-BioticsLab.rom" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="server ${defaultmap}?game=KFmod.KFGameType?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" + +# Server Start Command for Objective mode +#defaultmap="KFO-Steamland" +#parms="server ${defaultmap}?Game=KFStoryGame.KFStoryGame?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="215360" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Killing Floor" +engine="unreal2" +glibc="2.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +serverfiles="${rootdir}/serverfiles" +systemdir="${serverfiles}/System" +executabledir="${systemdir}" +executable="./ucc-bin" +servercfg="${servicename}.ini" +servercfgdefault="Default.ini" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" +compressedmapsdir="${rootdir}/Maps-Compressed" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${servicename}-game.log" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" +gamelogdate="${gamelogdir}/${servicename}-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..6b3f09c9d --- /dev/null +++ b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg @@ -0,0 +1,140 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="c5m1_waterfront" +maxplayers="8" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game left4dead2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="222860" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Left 4 Dead 2" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/left4dead2" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg new file mode 100644 index 000000000..80dfee1e4 --- /dev/null +++ b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg @@ -0,0 +1,140 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="l4d_hospital01_apartment" +maxplayers="8" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game left4dead -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="222840" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Left 4 Dead" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/left4dead" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="server.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/mcserver/_default.cfg b/lgsm/config-default/config-lgsm/mcserver/_default.cfg new file mode 100644 index 000000000..7b744ff51 --- /dev/null +++ b/lgsm/config-default/config-lgsm/mcserver/_default.cfg @@ -0,0 +1,127 @@ +################################## +######## 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 +javaram="1024" # -Xmx$1024M + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="nogui" +} +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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" + +## LinuxGSM Server Details +# Do not edit +gamename="Minecraft" +engine="lwjgl2" +glibc="null" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="java -Xmx${javaram}M -jar ${serverfiles}/minecraft_server.jar" +servercfg="server.properties" +servercfgdefault="server.properties" +servercfgdir="${serverfiles}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/mhserver/_default.cfg b/lgsm/config-default/config-lgsm/mhserver/_default.cfg new file mode 100644 index 000000000..30f68f0cd --- /dev/null +++ b/lgsm/config-default/config-lgsm/mhserver/_default.cfg @@ -0,0 +1,138 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +beaconport="15000" +queryport="27015" +# Maps: FFA_Camp, FFA_Contraband, FFA_Grad, FFA_MountainPeak, FFA_Taiga, FFA_ThePit, FFA_Tourney, SKM_Camp, SKM_Contraband, SKM_Grad, SKM_MountainPeak, SKM_Taiga, SKM_ThePit, SKM_Tourney, TDM_Camp, TDM_Contraband, TDM_Grad, TDM_MountainPeak, TDM_Taiga, TDM_ThePit, TDM_Tourney +defaultmap="FFA_ThePit" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="Mordhau ${defaultmap} -log -MultiHome=${ip} -Port=${port} -BeaconPort=${beaconport} -QueryPort=${queryport}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="629800" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="MORDHAU" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/Mordhau" +executabledir="${systemdir}/Binaries/Linux" +executable="./MordhauServer-Linux-Shipping" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="Game.ini" +servercfgdefault="Game.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg new file mode 100644 index 000000000..cbe998b5a --- /dev/null +++ b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg @@ -0,0 +1,123 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Edit with care +fn_parms(){ +parms="" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Multi Theft Auto" +engine="renderware" +glibc="2.7" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +resourcesdir="${systemdir}/mods/deathmatch/resources" +executabledir="${systemdir}" +executable="./mta-server64" +servercfg="mtaserver.conf" +servercfgdir="${systemdir}/mods/deathmatch" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/mods/deathmatch/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg b/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg new file mode 100644 index 000000000..0404d5834 --- /dev/null +++ b/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg @@ -0,0 +1,126 @@ +################################## +######## 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 #### +# Use .ini config file for Mumble (Murmur) server. + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-fg -ini ${servercfgfullpath}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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" + +## LinuxGSM Server Details +# Do not edit +gamename="Mumble" +engine="null" +glibc="null" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./murmur.x86" +servercfg="${servicename}.ini" +servercfgdefault="murmur.ini" +servercfgdir="${serverfiles}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +#gamelogdir="" # No server logs available +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ndserver/_default.cfg b/lgsm/config-default/config-lgsm/ndserver/_default.cfg new file mode 100644 index 000000000..ce6932680 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ndserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="hydro" +maxplayers="32" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game nucleardawn -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="111710" +# 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="Nuclear Dawn" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/nucleardawn" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg new file mode 100644 index 000000000..a59455630 --- /dev/null +++ b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg @@ -0,0 +1,146 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="nmo_broadway" +maxplayers="8" + +## Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://linuxgsm.com/gslt +gslt="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game nmrih -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="317670" +# 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="No More Room in Hell" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/nmrih" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg new file mode 100644 index 000000000..bedb28177 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -0,0 +1,147 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +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 Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="313900" +# 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="NS2: Combat" +engine="spark" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}/ia32" +executable="./ns2combatserver_linux32" +servercfgdir="${serverfiles}/${servicename}" +servercfgfullpath="${servercfgdir}" +modstoragedir="${servercfgdir}/Workshop" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg new file mode 100644 index 000000000..3c6c0e34a --- /dev/null +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -0,0 +1,151 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +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 Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -logdir \"${gamelogdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="4940" +# 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="Natural Selection 2" +engine="spark" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}/x64" +executable="./server_linux" +servercfgdir="${serverfiles}/${servicename}" +servercfgfullpath="${servercfgdir}" +modstoragedir="${servercfgdir}/Workshop" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/nsserver/_default.cfg b/lgsm/config-default/config-lgsm/nsserver/_default.cfg new file mode 100644 index 000000000..0bd6f4e9b --- /dev/null +++ b/lgsm/config-default/config-lgsm/nsserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="ns_hera" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game ns -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="90" +appidmod="cstrike" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## LinuxGSM Server Details +# Do not edit +gamename="Natural Selection" +engine="goldsource" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/ns" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/opforserver/_default.cfg b/lgsm/config-default/config-lgsm/opforserver/_default.cfg new file mode 100644 index 000000000..278288e74 --- /dev/null +++ b/lgsm/config-default/config-lgsm/opforserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="op4_bootcamp" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game gearbox -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="90" +appidmod="gearbox" +# 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="Half-Life: Opposing Force" +engine="goldsource" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/gearbox" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/pcserver/_default.cfg b/lgsm/config-default/config-lgsm/pcserver/_default.cfg new file mode 100644 index 000000000..b2c26aaad --- /dev/null +++ b/lgsm/config-default/config-lgsm/pcserver/_default.cfg @@ -0,0 +1,133 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="--config ${servercfg}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="332670" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Project Cars" +engine="madness" +glibc="2.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./DedicatedServerCmd" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg new file mode 100644 index 000000000..9b4f6762c --- /dev/null +++ b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg @@ -0,0 +1,145 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters + +ip="0.0.0.0" +randommap="ALWAYS" +port="10027" +queryport="10037" +#servername="LinuxGSM Server" +# If your server is not meeting the minimal server requirement, do not host the server for 80 players, decrease that number. +maxplayers="40" +numreservedslots="2" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="MULTIHOME=${ip}?RANDOM=${randommap}?Port=${port}?QueryPort=${queryport}?MaxPlayers=${maxplayers}?NumReservedSlots=${numreservedslots}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="746200" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="pstbsserver" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/PostScriptum" +executabledir="${serverfiles}" +executable="./PostScriptumServer.sh" +servercfg="Server.cfg" +servercfgdefault="Server.cfg" +servercfgdir="${systemdir}/ServerConfig" +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}/${servicename}-game.log" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg new file mode 100644 index 000000000..407324f3b --- /dev/null +++ b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="bt_island" +maxplayers="24" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game pvkii -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="17575" +# 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="Pirates, Vikings, and Knights II" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/pvkii" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/pzserver/_default.cfg b/lgsm/config-default/config-lgsm/pzserver/_default.cfg new file mode 100644 index 000000000..c5db5f93a --- /dev/null +++ b/lgsm/config-default/config-lgsm/pzserver/_default.cfg @@ -0,0 +1,136 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +adminpassword="CHANGE_ME" + +fn_parms(){ +parms="-ip ${ip} -adminpassword \"${adminpassword}\" -servername ${servicename}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="380870" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Project Zomboid" +engine="projectzomboid" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./start-server.sh" +servercfg="${servicename}.ini" +servercfgdefault="server.ini" +servercfgdir="${HOME}/Zomboid/Server" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${HOME}/Zomboid/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/q2server/_default.cfg b/lgsm/config-default/config-lgsm/q2server/_default.cfg new file mode 100644 index 000000000..4369281e4 --- /dev/null +++ b/lgsm/config-default/config-lgsm/q2server/_default.cfg @@ -0,0 +1,127 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27910" +defaultmap="q2dm1" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="+set dedicated 1 +set ip ${ip} +set port ${port} +exec ${servercfg} +set deathmatch 1 +map ${defaultmap}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Quake 2" +engine="idtech2" +glibc="null" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/baseq2" +executabledir="${serverfiles}" +executable="./quake2" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/q3server/_default.cfg b/lgsm/config-default/config-lgsm/q3server/_default.cfg new file mode 100644 index 000000000..2f1bc15f4 --- /dev/null +++ b/lgsm/config-default/config-lgsm/q3server/_default.cfg @@ -0,0 +1,127 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27960" +defaultmap="q3dm17" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set com_hunkMegs 32 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Quake 3: Arena" +engine="idtech3" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/baseq3" +executabledir="${serverfiles}" +executable="./q3ded" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/qlserver/_default.cfg b/lgsm/config-default/config-lgsm/qlserver/_default.cfg new file mode 100644 index 000000000..0535d7789 --- /dev/null +++ b/lgsm/config-default/config-lgsm/qlserver/_default.cfg @@ -0,0 +1,136 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Edit with care | Install/Config Guide : https://steamcommunity.com/sharedfiles/filedetails/?id=542966946 +# Console Commands : http://www.regurge.at/ql +fn_parms(){ +parms="+exec ${servercfg}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="349090" +# 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="Quake Live" +engine="idtech3_ql" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable=$([ "$(uname -m)" == "x86_64" ] && echo "./run_server_x64.sh" || echo "./run_server_x86.sh") +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${serverfiles}/baseq3" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${servicename}-game.log" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/qwserver/_default.cfg b/lgsm/config-default/config-lgsm/qwserver/_default.cfg new file mode 100644 index 000000000..f9fd737f4 --- /dev/null +++ b/lgsm/config-default/config-lgsm/qwserver/_default.cfg @@ -0,0 +1,126 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27500" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-port ${port} -game ktx +exec ${servercfg}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="QuakeWorld" +engine="quake" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/ktx" +executabledir="${serverfiles}" +executable="./mvdsv" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg new file mode 100644 index 000000000..727f1ddc5 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="rc_arena" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game ricochet -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="90" +appidmod="ricochet" +# 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="Ricochet" +engine="goldsource" +glibcr="2.3.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/ricochet" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/roserver/_default.cfg b/lgsm/config-default/config-lgsm/roserver/_default.cfg new file mode 100644 index 000000000..0ecfaad5d --- /dev/null +++ b/lgsm/config-default/config-lgsm/roserver/_default.cfg @@ -0,0 +1,145 @@ +################################## +######## 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" +defaultmap="RO-Arad.rom" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="server ${defaultmap}?game=ROGame.ROTeamGame?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="223250" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Red Orchestra: Ostfront 41-45" +engine="unreal2" +glibc="2.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +serverfiles="${rootdir}/serverfiles" +systemdir="${serverfiles}/system" +executabledir="${systemdir}" +executable="./ucc-bin" +servercfg="${servicename}.ini" +servercfgdefault="default.ini" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" +compressedmapsdir="${rootdir}/Maps-Compressed" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${servicename}-game.log" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" +gamelogdate="${gamelogdir}/${servicename}-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..cf1373e64 --- /dev/null +++ b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg @@ -0,0 +1,127 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27960" +defaultmap="mp_beach" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 1 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Return to Castle Wolfenstein" +engine="ioquake3" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/main" +executabledir="${serverfiles}" +executable="./iowolfded.x86_64" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg new file mode 100644 index 000000000..7167acd03 --- /dev/null +++ b/lgsm/config-default/config-lgsm/rustserver/_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 +# More settings available after install in serverfiles/server/rust-server/server.cfg +ip="0.0.0.0" +port="28015" +rconport="28016" +rconpassword="CHANGE_ME" +rconweb="1" # Value is: 1 for Facepunch's web panel; 0 for RCON tools like Rusty or Rustadmin +servername="Rust" +maxplayers="50" + +# Advanced Start Settings +seed="" # default random; range : 1 to 2147483647 ; used to change or reproduce a procedural map +salt="" # default random; range : unknown range ; used to recover a known setting from an existing map +worldsize="3000" # default 3000; range : 1000 to 6000 ; map size in meters +saveinterval="300" # Auto-save in seconds +tickrate="30" # default 30; range : 15 to 100 + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +# Specific to Rust +if [ -n "${seed}" ]; then + # If set, then add to start parms + conditionalseed="+server.seed ${seed}" +else + # Keep randomness of the number if not set + conditionalseed="" +fi +if [ -n "${salt}" ]; then + # If set, then add to start parms + conditionalsalt="+server.salt ${salt}" +else + # Keep randomness of the number if not set + conditionalsalt="" +fi +parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${servicename}\" ${conditionalseed} ${conditionalsalt} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile \"${gamelogdate}\"" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="258550" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Rust" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./RustDedicated" +serveridentitydir="${systemdir}/server/${servicename}" +servercfg="server.cfg" +servercfgdefault="server.cfg" +servercfgdir="${serveridentitydir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" +gamelogdate="${gamelogdir}/${servicename}-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..7f4222b30 --- /dev/null +++ b/lgsm/config-default/config-lgsm/rwserver/_default.cfg @@ -0,0 +1,136 @@ +################################## +######## 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 +javaram="2048" # -Xmx$2048M + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="339010" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Rising World" +engine="risingworld" +glibc="null" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="java -Xmx${javaram}m -jar ${serverfiles}/server.jar" +servercfg="server.properties" +servercfgdefault="server.properties" +servercfgdir="${serverfiles}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/sampserver/_default.cfg b/lgsm/config-default/config-lgsm/sampserver/_default.cfg new file mode 100644 index 000000000..b76e92538 --- /dev/null +++ b/lgsm/config-default/config-lgsm/sampserver/_default.cfg @@ -0,0 +1,125 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="San Andreas Multiplayer" +engine="renderware" +glibc="2.3" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${systemdir}/samp03" +executable="./samp03svr" +servercfg="server.cfg" +servercfgdir="${systemdir}/samp03" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/samp03" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg new file mode 100644 index 000000000..c9e6d450a --- /dev/null +++ b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg @@ -0,0 +1,138 @@ +################################## +######## 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 +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 Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="Port=${port}?QueryPort=${queryport} -startup_map ${defaultmap} -server_name \"${servername}\"" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="974130" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="StickyBots" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${systemdir}/blank1/Binaries/Linux" +executable="./blank1Server-Linux-Shipping" +servercfg="Game.ini" +servercfgdefault="Game.ini" +servercfgdir="${systemdir}/blank1/Saved/Config/LinuxServer" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/sbserver/_default.cfg b/lgsm/config-default/config-lgsm/sbserver/_default.cfg new file mode 100644 index 000000000..3f157a72a --- /dev/null +++ b/lgsm/config-default/config-lgsm/sbserver/_default.cfg @@ -0,0 +1,139 @@ +################################## +######## 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" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="211820" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +steammaster="flase" + +## LinuxGSM Server Details +# Do not edit +gamename="Starbound" +engine="starbound" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}/linux" +executable="./starbound_server" +servercfg="starbound_server.config" +servercfgdefault="starbound_server.config" +servercfgdir="${serverfiles}/storage" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/storage" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg new file mode 100644 index 000000000..06d97810f --- /dev/null +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -0,0 +1,139 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-logfile ${gamelogdir}/output_log__$(date +%Y-%m-%d__%H-%M-%S).txt -quit -batchmode -nographics -dedicated -configfile=${servercfgfullpath}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="294420" +# 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="7 Days To Die" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable=$([ "$(uname -m)" == "x86_64" ] && echo "./7DaysToDieServer.x86_64" || echo "./7DaysToDieServer.x86") +servercfgdefault="serverconfig.xml" +servercfgdirdefault="${serverfiles}" +servercfgfullpathdefault="${servercfgdirdefault}/${servercfgdefault}" +servercfg="${servicename}.xml" +servercfgdir="${serverfiles}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${servicename}-game.log" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/sof2server/_default.cfg b/lgsm/config-default/config-lgsm/sof2server/_default.cfg new file mode 100644 index 000000000..897be4a3e --- /dev/null +++ b/lgsm/config-default/config-lgsm/sof2server/_default.cfg @@ -0,0 +1,127 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="20100" +defaultmap="mp_shop" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="+set sv_punkbuster 0 +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Soldier Of Fortune 2: Gold Edition" +engine="idtech3" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/main" +executabledir="${serverfiles}" +executable="./sof2ded" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/squadserver/_default.cfg b/lgsm/config-default/config-lgsm/squadserver/_default.cfg new file mode 100644 index 000000000..3c2109527 --- /dev/null +++ b/lgsm/config-default/config-lgsm/squadserver/_default.cfg @@ -0,0 +1,139 @@ +################################## +######## 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 +port="7787" +queryport="27165" +randommap="ALWAYS" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="MULTIHOME=${ip} RANDOM=${randommap} Port=${port} QueryPort=${queryport}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="403240" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Squad" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/Squad" +executabledir="${serverfiles}" +executable="./SquadGameServer.sh" +servercfg="${servicename}.cfg" +servercfgdefault="Server.cfg" +servercfgdir="${systemdir}/ServerConfig" +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}/${servicename}-game.log" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ss3server/_default.cfg b/lgsm/config-default/config-lgsm/ss3server/_default.cfg new file mode 100644 index 000000000..bb6f78a1b --- /dev/null +++ b/lgsm/config-default/config-lgsm/ss3server/_default.cfg @@ -0,0 +1,139 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Edit with care | https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master/SeriousSam3BFE/help/DedicatedServer_Readme.txt +fn_parms(){ +parms="+ip ${ip} +logfile ${gamelog} +exec ${servercfgfullpath}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="41080" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Serious Sam 3: BFE" +engine="seriousengine35" +glibc="2.13" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/Bin" +executable="./runSam3_DedicatedServer.sh" +executabledir="${systemdir}" +servercfg="${servicename}.ini" +servercfgdefault="server.ini" +servercfgdir="${serverfiles}/Content/SeriousSam3/Config" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${servicename}-game.log" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" +gamelogdate="${gamelogdir}/${servicename}-game-$(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..93a59f2f8 --- /dev/null +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -0,0 +1,143 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27500" +queryport="27015" +worldtype="Moon" +autosaveinterval=300 +clearinterval=60 +worldname="moon_save" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Edit with care | http://hurtworld.wikia.com/wiki/Hosting_A_Server +fn_parms(){ +parms="-batchmode -nographics -autostart -gameport=${port} -updateport=${queryport} -worldtype=${worldtype} -loadworld=${worldname} -worldname=${worldname} -autosaveinterval=${autosaveinterval} -clearallinterval=${clearinterval}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="600760" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Stationeers" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./rocketstation_DedicatedServer.x86_64" +servercfg="default.ini" +servercfgdefault="default.ini" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${HOME}/.config/unity3d/Rocketwerkz/Stationeers" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/svenserver/_default.cfg b/lgsm/config-default/config-lgsm/svenserver/_default.cfg new file mode 100644 index 000000000..91912d425 --- /dev/null +++ b/lgsm/config-default/config-lgsm/svenserver/_default.cfg @@ -0,0 +1,140 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="svencoop1" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game svencoop -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} +maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="276060" +# 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="Sven Co-op" +engine="goldsource" +glibc="2.24" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/svencoop" +executabledir="${serverfiles}" +executable="./svends_run" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg new file mode 100644 index 000000000..3dc5646f4 --- /dev/null +++ b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg @@ -0,0 +1,140 @@ +################################## +######## 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" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-config ${servercfgfullpath}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="105600" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Terraria" +engine="terraria" +glibc="2.7" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./TerrariaServer" +servercfg="${servicename}.txt" +servercfgdefault="serverconfig.txt" +servercfgdir="${serverfiles}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +#gamelogdir="" # No server logs available +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/tf2server/_default.cfg b/lgsm/config-default/config-lgsm/tf2server/_default.cfg new file mode 100644 index 000000000..2bcade720 --- /dev/null +++ b/lgsm/config-default/config-lgsm/tf2server/_default.cfg @@ -0,0 +1,146 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="cp_badlands" +maxplayers="16" + +## Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://linuxgsm.com/gslt +gslt="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game tf -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="232250" +# 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="Team Fortress 2" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/tf" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg new file mode 100644 index 000000000..b34d820b7 --- /dev/null +++ b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="dustbowl" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game tfc -strictportbind _ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="90" +appidmod="tfc" +# 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="Team Fortress Classic" +engine="goldsource" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/tfc" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ts3server/_default.cfg b/lgsm/config-default/config-lgsm/ts3server/_default.cfg new file mode 100644 index 000000000..47da3e4b6 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ts3server/_default.cfg @@ -0,0 +1,119 @@ +################################## +######## 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 Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +# Edit serverfiles/ts3server.ini after installation + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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" + +## LinuxGSM Server Details +# Do not edit +gamename="TeamSpeak 3" +servername="TeamSpeak 3 Server" +engine="null" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./ts3server_startscript.sh" +servercfg="${servicename}.ini" +servercfgdefault="ts3server.ini" +servercfgdir="${serverfiles}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/logs" +lgsmlogdir="${logdir}/script" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" 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..6207f5c31 --- /dev/null +++ b/lgsm/config-default/config-lgsm/tuserver/_default.cfg @@ -0,0 +1,143 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +queryport="27015" + +## Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://linuxgsm.com/gslt +gslt="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-log -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -TowerServerINI=${servicename}.ini" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="439660" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Tower Unite" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/Tower" +executabledir="${systemdir}/Binaries/Linux" +executable="./TowerServer-Linux-Shipping" +servercfgdir="${systemdir}/Binaries/Linux" +servercfg="${servicename}.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="TowerServer.ini" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/twserver/_default.cfg b/lgsm/config-default/config-lgsm/twserver/_default.cfg new file mode 100644 index 000000000..56d505183 --- /dev/null +++ b/lgsm/config-default/config-lgsm/twserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## 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" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-f ${servercfg}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="380840" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Teeworlds" +engine="teeworlds" +glibc="2.14" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/tw" +executabledir="${systemdir}" +executable="./teeworlds_srv" +servercfg="${servicename}.cfg" # Teeworlds can also auto load any config if an autoexec.cfg file is present in the server dir +servercfgdefault="server.cfg" +servercfgdir="${serverfiles}/tw" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${servicename}-game.log" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg new file mode 100644 index 000000000..2913f0ea8 --- /dev/null +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -0,0 +1,144 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +maxplayers="20" +defaultmap="pei" + +## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login +steamuser="username" +steampass='password' + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters + +# Parameters are changed in game.ini and engine.ini (Location: ${systemdir}/Saved/Config/LinuxServer) +# Make sure you change the admin password before launching the server + +fn_parms(){ +parms="-port:${port} -players:${maxplayers} --nographics -${defaultmap} -batchmode +secureserver/${servicename}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="304930" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Unturned" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./Unturned_Headless.x86" +servercfgdir="${systemdir}/Servers/${servicename}" +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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg new file mode 100644 index 000000000..9f43be864 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg @@ -0,0 +1,129 @@ +################################## +######## 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 +defaultmap="DM-Rankin" +ip="0.0.0.0" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="server ${defaultmap}?game=XGame.xDeathMatch -nohomedir ini=${servercfg} log=${gamelog}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Unreal Tournament 2004" +engine="unreal2" +glibc="2.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/System" +executabledir="${systemdir}" +executable="./ucc-bin" +servercfg="${servicename}.ini" +servercfgdefault="UT2004.ini" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" +compressedmapsdir="${rootdir}/Maps-Compressed" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${servicename}-game.log" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" +gamelogdate="${gamelogdir}/${servicename}-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..a1c4496bd --- /dev/null +++ b/lgsm/config-default/config-lgsm/ut3server/_default.cfg @@ -0,0 +1,139 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +queryport="6500" +defaultmap="VCTF-Suspense" +game="UTGameContent.UTVehicleCTFGame_Content" +mutators="" #"UTGame.UTMutator_Instagib,UTGame.UTMutator_LowGrav" +isdedicated="true" +islanmatch="false" +usesstats="false" +shouldadvertise="true" +pureserver="1" +allowjoininprogress="true" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Edit with care | List of game types and mutators : http://wiki.unrealadmin.org/FAQ:UT3 +fn_parms(){ +parms="server ${defaultmap}?Game=${game}?bIsDedicated=${isdedicated}?bIsLanMatch=${islanmatch}?bUsesStats=${usesstats}?bShouldAdvertise=${shouldadvertise}?PureServer=${pureserver}?bAllowJoinInProgress=${allowjoininprogress}?Mutator=${mutators}?ConfigSubDir=${servicename} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Unreal Tournament 3" +engine="unreal3" +glibc="2.3.2" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${systemdir}/Binaries" +executable="./ut3" +servercfg="UTGame.ini" +servercfgdefault="UTGame.ini" +servercfgdir="${systemdir}/UTGame/Config/${servicename}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${servicename}-game.log" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" +gamelogdate="${gamelogdir}/${servicename}-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..66d0edd41 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ut99server/_default.cfg @@ -0,0 +1,127 @@ +################################## +######## 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 +defaultmap="DM-Deck16][" +ip="0.0.0.0" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="server ${defaultmap}.unr ini=${servercfgfullpath}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Unreal Tournament 99" +engine="unreal" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/System" +executabledir="${systemdir}" +executable="./ucc-bin" +servercfg="${servicename}.ini" +servercfgdefault="Default.ini" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" +compressedmapsdir="${rootdir}/Maps-Compressed" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/utserver/_default.cfg b/lgsm/config-default/config-lgsm/utserver/_default.cfg new file mode 100644 index 000000000..9b29dd204 --- /dev/null +++ b/lgsm/config-default/config-lgsm/utserver/_default.cfg @@ -0,0 +1,129 @@ +################################## +######## 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 +# For CTF: defaultmap="CTF-Face" gametype="CTF" +ip="0.0.0.0" +port="7777" +defaultmap="DM-Underland" +gametype="DM" +timelimit="10" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="UnrealTournament ${defaultmap}?Game=${gametype}?TimeLimit=${timelimit} -port=${port}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Unreal Tournament" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/LinuxServer" +executabledir="${systemdir}/Engine/Binaries/Linux" +executable="./UE4Server-Linux-Shipping" +servercfg="Game.ini" +servercfgdir="${systemdir}/UnrealTournament/Saved/Config/LinuxServer" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/vsserver/_default.cfg b/lgsm/config-default/config-lgsm/vsserver/_default.cfg new file mode 100644 index 000000000..31d67e6e6 --- /dev/null +++ b/lgsm/config-default/config-lgsm/vsserver/_default.cfg @@ -0,0 +1,141 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="vs_frost" +maxplayers="16" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game vs -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="90" +appidmod="cstrike" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## LinuxGSM Server Details +# Do not edit +gamename="Vampire Slayer" +engine="goldsource" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/vs" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.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}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/wetserver/_default.cfg b/lgsm/config-default/config-lgsm/wetserver/_default.cfg new file mode 100644 index 000000000..ae88991cb --- /dev/null +++ b/lgsm/config-default/config-lgsm/wetserver/_default.cfg @@ -0,0 +1,122 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ + parms="+set net_strict 1 +set fs_homepath ${serverfiles} +exec ${servercfg}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## LinuxGSM Server Details +# Do not edit +gamename="Wolfenstein: Enemy Territory" +engine="idtech3" +glibc="2.2.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./etded" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/etmain" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg new file mode 100644 index 000000000..1263771cc --- /dev/null +++ b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg @@ -0,0 +1,132 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ + # Note Parameters are editing in the game server config file. + source "${servercfgfullpath}" + parms="ADMINPWD=\"$ADMINPWD\" EPICSETTINGS=\"$EPICSETTINGS\" EXTERNALPORT=\"$EXTERNALPORT\" HOMESERVER=\"$HOMESERVER\" HOMEKINGDOM=\"$HOMEKINGDOM\" LOGINSERVER=\"$LOGINSERVER\" MAXPLAYERS=\"$MAXPLAYERS\" QUERYPORT=\"$QUERYPORT\" SERVERNAME=\"$SERVERNAME\" SERVERPASSWORD=\"$SERVERPASSWORD\" START=\"$START\" IP=\"$IP\"" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="402370" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## LinuxGSM Server Details +# Do not edit +gamename="Wurm Unlimited" +engine="wurm" +glibc="2.14" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="xvfb-run ./WurmServerLauncher" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg new file mode 100644 index 000000000..e9acd034e --- /dev/null +++ b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg @@ -0,0 +1,146 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="zps_deadend" +maxplayers="20" + +## Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://linuxgsm.com/gslt +gslt="" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-game zps -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="17505" +# 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="Zombie Panic! Source" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/zps" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/data/alert_discord_logo.png b/lgsm/data/alert_discord_logo.png new file mode 100644 index 000000000..e56a92932 Binary files /dev/null and b/lgsm/data/alert_discord_logo.png differ diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv new file mode 100644 index 000000000..b9494bede --- /dev/null +++ b/lgsm/data/serverlist.csv @@ -0,0 +1,93 @@ +arma3,arma3server,ARMA 3 +sdtd,sdtdserver,7 Days to Die +ark,arkserver,ARK: Survival Evolved +bo,boserver,Ballistic Overkill +bf1942,bf1942server,Battlefield 1942 +bd,bdserver,Base Defense +bmdm,bmdmserver,Black Mesa: Deathmatch +bs,bsserver,Blade Symphony +bb,bbserver,BrainBread +bb2,bb2server,BrainBread 2 +bt1944,bt1944server,Battalion 1944 +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 +cc,ccserver,Codename CURE +cs,csserver,Counter-Strike 1.6 +cscz,csczserver,Counter-Strike: Condition Zero +csgo,csgoserver,Counter-Strike: Global Offensive +css,cssserver,Counter-Strike: Source +dod,dodserver,Day of Defeat +dods,dodsserver,Day of Defeat: Source +doi,doiserver,Day of Infamy +dmc,dmcserver,Deathmatch Classic +dst,dstserver,Don't Starve Together +dab,dabserver,Double Action: Boogaloo +dys,dysserver,Dystopia +eco,ecoserver,Eco +em,emserver,Empires Mod +fctr,fctrserver,Factorio +fof,fofserver,Fistful of Frags +gmod,gmodserver,Garrys Mod +ges,gesserver,GoldenEye: Source +hl2dm,hl2dmserver,Half-Life 2: Deathmatch +hldms,hldmsserver,Half-Life Deathmatch: Source +hldm,hldmserver,Half-Life: Deathmatch +hw,hwserver,Hurtworld +ins,insserver,Insurgency +inss,inssserver,Insurgency: Sandstorm +ios,iosserver,IOSoccer +jc2,jc2server,Just Cause 2 +jc3,jc3server,Just Cause 3 +kf,kfserver,Killing Floor +kf2,kf2server,Killing Floor 2 +l4d,l4dserver,Left 4 Dead +l4d2,l4d2server,Left 4 Dead 2 +mc,mcserver,Minecraft +mh,mhserver,MORDHAU +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 +opfor,opforserver,Opposing Force +pstbs,pstbsserver,Post Scriptum: The Bloody Seventh +pvkii,pvkiiserver,Pirates Vikings & Knights II +pc,pcserver,Project Cars +pz,pzserver,Project Zomboid +q2,q2server,Quake 2 +q3,q3server,Quake 3: Arena +ql,qlserver,Quake Live +qw,qwserver,Quake World +ro,roserver,Red Orchestra: Ostfront 41-45 +ricochet,ricochetserver,Ricochet +rtcw,rtcwserver,Return to Castle Wolfenstein +rust,rustserver,Rust +rw,rwserver, Rising World +samp,sampserver,San Andreas Multiplayer +sbots,sbotsserver, StickyBots +sof2,sof2server,Soldier Of Fortune 2: Gold Edition +ss3,ss3server,Serious Sam 3: BFE +sb,sbserver,Starbound +st,stserver,Stationeers +squad,squadserver,Squad +sven,svenserver,Sven Co-op +tf2,tf2server,Team Fortress 2 +tfc,tfcserver,Team Fortress Classic +ts3,ts3server,Teamspeak 3 +tw,twserver,Teeworlds +terraria,terrariaserver,Terraria +tu,tuserver,Tower Unite +ut2k4,ut2k4server,Unreal Tournament 2004 +ut3,ut3server,Unreal Tournament 3 +ut99,ut99server,Unreal Tournament 99 +unt,untserver,Unturned +vs,vsserver,Vampire Slayer +wet,wetserver,Wolfenstein: Enemy Territory +wurm,wurmserver,Wurm Unlimited +etl,etlserver,ET: Legacy +zps,zpsserver,Zombie Panic! Source diff --git a/lgsm/functions/README.md b/lgsm/functions/README.md index f18a8a161..01de5f0c7 100644 --- a/lgsm/functions/README.md +++ b/lgsm/functions/README.md @@ -1,11 +1,11 @@ -

      Linux Game Server Manager - Functions

      +# Linux Game Server Manager - Functions These functions are universal functions that work in all scripts. -

      Function Names

      +## Function Names Functions have been named to give an idea of what the function does. -* core: Essential functions that are will always run first. +* core: Essential functions that will always run first. * command: Primary command function. * check: Runs checks that will either halt on or fix an issue. * dev: development functions. diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 9cef86e95..a5b753f0d 100644 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -1,44 +1,125 @@ #!/bin/bash -# LGSM alert.sh function +# LinuxGSM alert.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Overall function for managing alerts. local commandname="ALERT" local commandaction="Alert" +fn_alert_log(){ + info_distro.sh + info_config.sh + info_messages.sh + if [ -f "${alertlog}" ]; then + rm "${alertlog}" + fi + + { + fn_info_message_head + fn_info_message_distro + fn_info_message_performance + fn_info_message_disk + 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="LGSM - Test Alert - ${servername}" - alertbody="LGSM test alert, how you read?" + alertsubject="Alert - ${servicename} - Test" + alertemoji="🚧" + alertsound="1" + alerturl="not enabled" + alertbody="Testing LinuxGSM Alert. No action to be taken." } fn_alert_restart(){ - fn_script_log_info "Sending restart alert: ${executable} process not running" - alertsubject="LGSM - Restarted - ${servername}" - alertbody="${servicename} ${executable} process not running" + fn_script_log_info "Sending alert: Restarted: ${executable} not running" + alertsubject="Alert - ${servicename} - Restarted" + alertemoji="🚨" + alertsound="2" + alerturl="not enabled" + alertbody="${servicename} ${executable} not running" } fn_alert_restart_query(){ - fn_script_log_info "Sending restart alert: ${gsquerycmd}" - alertsubject="LGSM - Restarted - ${servername}" - alertbody="gsquery.py failed to query: ${gsquerycmd}" + fn_script_log_info "Sending alert: Restarted: ${servicename}" + alertsubject="Alert - ${servicename} - Restarted" + alertemoji="🚨" + alertsound="2" + alerturl="not enabled" + alertbody="Unable to query: ${servicename}" } fn_alert_update(){ - fn_script_log_info "Sending update alert" - alertsubject="LGSM - Updated - ${servername}" - alertbody="${servicename} received update" + fn_script_log_info "Sending alert: Updated" + alertsubject="Alert - ${servicename} - Updated" + alertemoji="🎮" + alertsound="1" + alerturl="not enabled" + alertbody="${gamename} received update" +} + +fn_alert_permissions(){ + fn_script_log_info "Sending alert: Permissions error" + alertsubject="Alert - ${servicename}: Permissions error" + alertemoji="❗" + alertsound="2" + alerturl="not enabled" + alertbody="${servicename} has permissions issues" +} + +fn_alert_config(){ + fn_script_log_info "Sending alert: New _default.cfg" + alertsubject="Alert - ${servicename} - New _default.cfg" + alertemoji="🎮" + alertsound="1" + alerturl="not enabled" + alertbody="${servicename} has recieved a new _default.cfg. Check file for changes." } -if [ "${alert}" == "restart" ]; then +if [ "${alert}" == "permissions" ]; then + fn_alert_permissions +elif [ "${alert}" == "restart" ]; then fn_alert_restart elif [ "${alert}" == "restartquery" ]; then fn_alert_restart_query -elif [ "${alert}" == "update" ]; then - fn_alert_update elif [ "${alert}" == "test" ]; then fn_alert_test +elif [ "${alert}" == "update" ]; then + fn_alert_update +elif [ "${alert}" == "config" ]; then + fn_alert_config +fi + +# Generate alert log. +fn_alert_log + +# Generates the more info link. +if [ "${postalert}" == "on" ]&&[ -n "${postalert}" ]; then + alertflag=1 + command_postdetails.sh +elif [ "${postalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_warn_nl "More Info not enabled" + fn_script_log_warn "More Info alerts not enabled" +elif [ -z "${posttarget}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_error_nl "posttarget not set" + fn_script_error "posttarget not set" +elif [ -z "${postdays}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_error_nl "postdays not set" + fn_script_error "postdays not set" +fi + +if [ "${discordalert}" == "on" ]&&[ -n "${discordalert}" ]; then + alert_discord.sh +elif [ "${discordalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_warn_nl "Discord alerts not enabled" + fn_script_log_warn "Discord alerts not enabled" +elif [ -z "${discordtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_error_nl "Discord token not set" + echo " * https://docs.linuxgsm.com/alerts/discord" + fn_script_error "Discord token not set" fi if [ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then @@ -51,6 +132,28 @@ elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; t fn_script_log_error "Email not set" fi +if [ "${iftttalert}" == "on" ]&&[ -n "${iftttalert}" ]; then + alert_ifttt.sh +elif [ "${iftttalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_warn_nl "IFTTT alerts not enabled" + fn_script_log_warn "IFTTT alerts not enabled" +elif [ -z "${ifttttoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_error_nl "IFTTT token not set" + echo " * https://docs.linuxgsm.com/alerts/ifttt" + fn_script_error "IFTTT token not set" +fi + +if [ "${mailgunalert}" == "on" ]&&[ -n "${mailgunalert}" ]; then + alert_mailgun.sh +elif [ "${mailgunalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_warn_nl "Mailgun alerts not enabled" + fn_script_log_warn "Mailgun alerts not enabled" +elif [ -z "${mailguntoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_error_nl "Mailgun token not set" + echo " * https://docs.linuxgsm.com/alerts/mailgun" + fn_script_error "Mailgun token not set" +fi + if [ "${pushbulletalert}" == "on" ]&&[ -n "${pushbullettoken}" ]; then alert_pushbullet.sh elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then @@ -58,5 +161,32 @@ elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test fn_script_log_warn "Pushbullet alerts not enabled" elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then fn_print_error_nl "Pushbullet token not set" - fn_script_error_warn "Pushbullet token not set" -fi \ No newline at end of file + echo " * 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" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_warn_nl "Pushover alerts not enabled" + fn_script_log_warn "Pushover alerts not enabled" +elif [ -z "${pushovertoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_error_nl "Pushover token not set" + echo " * https://docs.linuxgsm.com/alerts/pushover" + fn_script_error "Pushover token not set" +fi + +if [ "${telegramalert}" == "on" ]&&[ -n "${telegramtoken}" ]; then + alert_telegram.sh +elif [ "${telegramalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_warn_nl "Telegram Messages not enabled" + fn_script_log_warn "Telegram Messages not enabled" +elif [ -z "${telegramtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_error_nl "Telegram token not set." + echo " * https://docs.linuxgsm.com/alerts/telegram" + fn_script_error "Telegram token not set." +elif [ -z "${telegramchatid}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_error_nl "Telegram chat id not set." + echo " * https://docs.linuxgsm.com/alerts/telegram" + fn_script_error "Telegram chat id not set." +fi diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh new file mode 100644 index 000000000..0d4b22123 --- /dev/null +++ b/lgsm/functions/alert_discord.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# LinuxGSM alert_discord.sh function +# Author: Daniel Gibbs +# Contributor: faflfama, diamondburned +# Website: https://linuxgsm.com +# Description: Sends Discord alert. + +if ! command -v jq > /dev/null; then + fn_print_fail_nl "Sending Discord alert: jq is missing." + fn_script_log_fatal "Sending Discord alert: jq is missing." +fi + +escaped_servername="$(echo -n "${servername}" | jq -sRr "@json")" +escaped_alertbody="$(echo -n "${alertbody}" | jq -sRr "@json")" + +json=$(cat <> "${emaillog}" -} - - -fn_details_os(){ - # - # 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 "Distro Details" - echo -e "=================================" - echo -e "Distro: ${distroname}" - echo -e "Arch: ${arch}" - echo -e "Kernel: ${kernel}" - echo -e "Hostname: $HOSTNAME" - echo -e "tmux: ${tmuxv}" - echo -e "GLIBC: ${glibcversion}" - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 -} - -fn_details_performance(){ - # - # Performance - # ===================================== - # Uptime: 55d, 3h, 38m - # Avg Load: 1.00, 1.01, 0.78 - # - # Mem: total used free - # Physical: 741M 656M 85M - # Swap: 0B 0B 0B - - { - echo -e "" - echo -e "Performance" - echo -e "=================================" - echo -e "Uptime: ${days}d, ${hours}h, ${minutes}m" - echo -e "Avg Load: ${load}" - echo -e "" - echo -e "Mem: total used free" - echo -e "Physical: ${physmemtotal} ${physmemused} ${physmemfree}" - echo -e "Swap: ${swaptotal} ${swapused} ${swapfree}" - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 -} - -fn_details_disk(){ - # - # Storage - # ===================================== - # Filesystem: /dev/disk/by-uuid/320c8edd-a2ce-4a23-8c9d-e00a7af2d6ff - # Total: 15G - # Used: 8.4G - # Available: 5.7G - # Serverfiles: 961M - - { - echo -e "" - echo -e "Storage" - echo -e "=================================" - echo -e "Filesystem: ${filesystem}" - echo -e "Total: ${totalspace}" - echo -e "Used: ${usedspace}" - echo -e "Available: ${availspace}" - echo -e "Serverfiles: ${filesdirdu}" - if [ -d "${backupdir}" ]; then - echo -e "Backups: ${backupdirdu}" - fi - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 -} - - - -fn_details_gameserver(){ - # - # Quake Live Server Details - # ===================================== - # Server name: ql-server - # Server IP: 1.2.3.4:27960 - # RCON password: CHANGE_ME - # Server password: NOT SET - # Maxplayers: 16 - # Status: OFFLINE - - { - echo -e "" - echo -e "${gamename} Server Details" - echo -e "=================================" - # Server name - echo -e "Server name: ${servername}" - - # Server ip - echo -e "Server IP: ${ip}:${port}" - - # Server password - if [ -n "${serverpassword}" ]; then - echo -e "Server password: ********" - fi - - # RCON password - if [ -n "${rconpassword}" ]; then - echo -e "RCON password: ********" - fi - - # Admin password - if [ -n "${adminpassword}" ]; then - echo -e "Admin password: ********" - fi - - # Stats password (Quake Live) - if [ -n "${statspassword}" ]; then - echo -e "Stats password: ********" - fi - - # Maxplayers - if [ -n "${maxplayers}" ]; then - echo -e "Maxplayers: ${maxplayers}" - fi - - # Game mode - if [ -n "${gamemode}" ]; then - echo -e "Game mode: ${gamemode}" - fi - - # Game world - if [ -n "${gameworld}" ]; then - echo -e "Game world: ${gameworld}" - fi - - # Tick rate - if [ -n "${tickrate}" ]; then - echo -e "Tick rate: ${tickrate}" - fi - - # TeamSpeak dbplugin - if [ -n "${dbplugin}" ]; then - echo -e "dbplugin: ${dbplugin}" - fi - - # Online status - if [ "${status}" == "0" ]; then - echo -e "Status: OFFLINE" - else - echo -e "Status: ONLINE" - fi - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 -} - -fn_alert_email_template_logs(){ - { - echo -e "" - echo -e "${servicename} Logs" - echo -e "=================================" - - if [ -n "${scriptlog}" ]; then - echo -e "\nScript log\n===================" - if [ ! "$(ls -A ${scriptlogdir})" ]; then - echo "${scriptlogdir} (NO LOG FILES)" - elif [ ! -s "${scriptlog}" ]; then - echo "${scriptlog} (LOG FILE IS EMPTY)" - else - echo "${scriptlog}" - tail -25 "${scriptlog}" - fi - echo "" - fi - - if [ -n "${consolelog}" ]; then - echo -e "\nConsole log\n====================" - if [ ! "$(ls -A ${consolelogdir})" ]; then - echo "${consolelogdir} (NO LOG FILES)" - elif [ ! -s "${consolelog}" ]; then - echo "${consolelog} (LOG FILE IS EMPTY)" - else - echo "${consolelog}" - tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }' - fi - echo "" - fi - - if [ -n "${gamelogdir}" ]; then - echo -e "\nServer log\n===================" - if [ ! "$(ls -A ${gamelogdir})" ]; then - echo "${gamelogdir} (NO LOG FILES)" - else - echo "${gamelogdir}" - tail "${gamelogdir}"/* | grep -v "==>" | sed '/^$/d' | tail -25 - fi - echo "" - fi - - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 -} - -fn_print_dots "Sending alert: ${email}" -fn_script_log_info "Sending alert: ${email}" -info_distro.sh -info_config.sh -info_glibc.sh -check_ip.sh - -emaillog="${emaillog}" -if [ -f "${emaillog}" ]; then - rm "${emaillog}" -fi -fn_details_email -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_alert_email_template_logs if [ -n "${emailfrom}" ]; then - mail -s "${alertsubject}" -a "From: ${emailfrom}" "${email}" < "${emaillog}" + mail -s "${alertsubject}" -r "${emailfrom}" "${email}" < "${alertlog}" else - mail -s "${alertsubject}" "${email}" < "${emaillog}" + mail -s "${alertsubject}" "${email}" < "${alertlog}" fi exitcode=$? if [ "${exitcode}" == "0" ]; then - fn_print_ok_nl "Sending alert: ${email}" - fn_script_log_pass "Sending alert: ${email}" + fn_print_ok_nl "Sending Email alert: ${email}" + fn_script_log_pass "Sending Email alert: ${email}" else - fn_print_fail_nl "Sending alert: ${email}" - fn_script_log_fatal "Sending alert: ${email}" + fn_print_fail_nl "Sending Email alert: ${email}" + fn_script_log_fatal "Sending Email alert: ${email}" fi \ No newline at end of file diff --git a/lgsm/functions/alert_ifttt.sh b/lgsm/functions/alert_ifttt.sh new file mode 100644 index 000000000..a99fd995b --- /dev/null +++ b/lgsm/functions/alert_ifttt.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# LinuxGSM alert_ifttt.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Sends IFTTT alert. + +local commandname="ALERT" +local commandaction="Alert" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +json=$(cat < +# Website: https://bytegaming.de +# Description: Sends Telegram Messenger alert. + +local commandname="ALERT" +local commandaction="Alert" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +json=$(cat <${alertsubject} ${alertemoji}\n\nMessage\n${alertbody}\n\nGame\n${gamename}\n\nServer name\n${servername}\n\nHostname\n${HOSTNAME}\n\nServer IP\n${alertip}:${port}\n\nMore info\n${alerturl}", + "disable_web_page_preview": "yes", +EOF +) + +fn_print_dots "Sending Telegram alert" +telegramsend=$(${curlpath} -sSL -H "Content-Type: application/json" -X POST -d """${json}""" "https://api.telegram.org/bot${telegramtoken}/sendMessage" ${curlcustomstring} | grep "error_code") + +if [ -n "${telegramsend}" ]; then + 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 index 25fead75b..21e63aca4 100644 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -1,32 +1,50 @@ #!/bin/bash -# LGSM check.sh function +# LinuxGSM check.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Overall function for managing checks. # Runs checks that will either halt on or fix an issue. local commandname="CHECK" -# Every command that requires checks just references check.sh -# check.sh selects which checks to run by using arrays +# Every command that requires checks just references check.sh. +# check.sh selects which checks to run by using arrays. + +if [ "${userinput}" != "install" ]&&[ "${userinput}" != "auto-install" ]&&[ "${userinput}" != "i" ]&&[ "${userinput}" != "ai" ]; then + check_root.sh +fi -check_root.sh check_tmuxception.sh -check_permissions.sh -if [ "${function_selfname}" != "command_install.sh" ]&&[ "${function_selfname}" != "command_update_functions.sh" ]; then +if [ "$(whoami)" != "root" ]; then + if [ "${function_selfname}" != "command_monitor.sh" ]; then + check_permissions.sh + fi +fi + +if [ "${function_selfname}" != "command_install.sh" ]&&[ "${function_selfname}" != "command_update_functions.sh" ]&&[ "${function_selfname}" != "command_update_linuxgsm.sh" ]&&[ "${function_selfname}" != "command_details.sh" ]&&[ "${function_selfname}" != "command_postdetails.sh" ]; then check_system_dir.sh fi -local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh ) +local allowed_commands_array=( command_start.sh command_debug.sh ) for allowed_command in "${allowed_commands_array[@]}" do if [ "${allowed_command}" == "${function_selfname}" ]; then - check_glibc.sh + check_executable.sh fi done -local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_ut99_maps.sh command_monitor.sh command_start.sh command_stop.sh command_update.sh command_validate.sh command_update_functions.sh command_email_test.sh ) +if [ "$(whoami)" != "root" ]; then + local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh ) + for allowed_command in "${allowed_commands_array[@]}" + do + if [ "${allowed_command}" == "${function_selfname}" ]; then + check_glibc.sh + fi + done +fi + +local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_fastdl.sh command_mods_install.sh command_mods_remove.sh command_mods_update.sh command_monitor.sh command_postdetails.sh command_restart.sh command_start.sh command_stop.sh command_test_alert.sh command_ts3_server_pass.sh command_update.sh command_update_functions.sh command_validate.sh command_wipe.sh command_unreal2_maps.sh command_ut99maps.sh) for allowed_command in "${allowed_commands_array[@]}" do if [ "${allowed_command}" == "${function_selfname}" ]; then @@ -42,29 +60,31 @@ do fi done -local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh ) +local allowed_commands_array=( command_console.sh command_debug.sh command_monitor.sh command_start.sh command_stop.sh ) for allowed_command in "${allowed_commands_array[@]}" do if [ "${allowed_command}" == "${function_selfname}" ]; then - check_ip.sh + check_config.sh fi done -local allowed_commands_array=( update_steamcmd.sh command_debug.sh command_start.sh command_validate.sh ) +local allowed_commands_array=( command_debug.sh command_details.sh command_postdetails.sh command_monitor.sh command_start.sh command_stop.sh command_dev_query_raw.sh ) for allowed_command in "${allowed_commands_array[@]}" do if [ "${allowed_command}" == "${function_selfname}" ]; then - if [ -n "${appid}" ]; then - check_steamcmd.sh + if [ -z "${installflag}" ]; then + check_ip.sh fi fi done -local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh ) +local allowed_commands_array=( update_steamcmd.sh command_debug.sh command_start.sh command_validate.sh ) for allowed_command in "${allowed_commands_array[@]}" do if [ "${allowed_command}" == "${function_selfname}" ]; then - check_config.sh + if [ -n "${appid}" ]; then + check_steamcmd.sh + fi fi done diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh index 72ea95c5c..2f507808b 100644 --- a/lgsm/functions/check_config.sh +++ b/lgsm/functions/check_config.sh @@ -1,29 +1,26 @@ #!/bin/bash -# LGSM check_config.sh function +# LinuxGSM check_config.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Checks if the server config is missing and warns the user if needed. local commandname="CHECK" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -e "${servercfgfullpath}" ]; then - if [ "${gamename}" != "Hurtworld" ]; then + if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then fn_print_dots "" - sleep 0.5 fn_print_warn_nl "Configuration file missing!" echo "${servercfgfullpath}" fn_script_log_warn "Configuration file missing!" fn_script_log_warn "${servercfgfullpath}" - sleep 1 install_config.sh fi fi -if [ "${gamename}" == "Rust" ]; then +if [ "${shortname}" == "rust" ]; then if [ -z "${rconpassword}" ]; then fn_print_dots "" - sleep 0.5 fn_print_fail_nl "RCON password is not set!" echo " * Not setting an RCON password causes issues with ${gamename}" fn_script_log_fatal "RCON password is not set" @@ -31,10 +28,8 @@ if [ "${gamename}" == "Rust" ]; then core_exit.sh elif [ "${rconpassword}" == "CHANGE_ME" ]; then fn_print_dots "" - sleep 0.5 fn_print_warn_nl "Default RCON Password detected!" echo " * Having ${rconpassword} as a password is not very safe." fn_script_log_warn "Default RCON Password detected" - sleep 2 fi fi diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 36e0a8f04..45423ec2d 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -1,15 +1,144 @@ #!/bin/bash -# LGSM check_deps.sh function +# LinuxGSM check_deps.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com -# Description: Checks if required dependencies are installed for LGSM. +# Website: https://linuxgsm.com +# Description: Checks if required dependencies are installed for LinuxGSM. local commandname="CHECK" +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 update" + eval ${cmd} + elif [ "${distroversion}" == "16.04" ]; then + cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https;echo 'deb https://download.mono-project.com/repo/ubuntu stable-xenial main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + eval ${cmd} + elif [ "${distroversion}" == "14.04" ]; then + cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https;echo 'deb https://download.mono-project.com/repo/ubuntu stable-trusty main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + eval ${cmd} + else + fn_print_warn_nl "Installing Mono repository" + echo "Mono auto install not available for ${distroname}" + echo " Follow instructions on mono site to install the latest version of Mono." + echo " https://www.mono-project.com/download/stable/#download-lin" + monoautoinstall="1" + fi + elif [ "${distroid}" == "debian" ]; then + if [ "${distroversion}" == "9" ]; then + cmd="sudo apt install apt-transport-https dirmngr;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-stretch main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + eval ${cmd} + elif [ "${distroversion}" == "8" ]; then + cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https;echo 'deb https://download.mono-project.com/repo/debian stable-jessie main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + eval ${cmd} + else + echo "Mono auto install not available for ${distroname}" + echo " Follow instructions on mono site to install the latest version of Mono." + echo " https://www.mono-project.com/download/stable/#download-lin" + 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} + elif [ "${distroversion}" == "6" ]; then + cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos6-stable.repo | tee /etc/yum.repos.d/mono-centos6-stable.repo'" + eval ${cmd} + else + echo "Mono auto install not available for ${distroname}" + echo " Follow instructions on mono site to install the latest version of Mono." + echo " https://www.mono-project.com/download/stable/#download-lin" + monoautoinstall="1" + fi + elif [ "${distroid}" == "fedora" ]; then + cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF'; su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'; dnf update" + eval ${cmd} + else + echo "Mono auto install not available for ${distroname}" + echo " Follow instructions on mono site to install the latest version of Mono." + echo " https://www.mono-project.com/download/stable/#download-lin" + 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 "" + fn_print_warning_nl "$(whoami) does not have sudo access. Manually install Mono repository." + fn_script_log_warn "$(whoami) does not have sudo access. Manually install Mono repository." + echo " Follow instructions on mono site to install the latest version of Mono." + echo " https://www.mono-project.com/download/stable/#download-lin" + 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 Repo" + 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 " Please run the following command as a user with sudo access, and re-run the installation" + echo " sudo apt-add-repository universe" + fi + fi +} fn_deps_detector(){ - # Checks if dependency is missing + # Checks if dependency is missing. if [ "${tmuxcheck}" == "1" ]; then # Added for users compiling tmux from source to bypass check. depstatus=0 @@ -20,53 +149,75 @@ fn_deps_detector(){ depstatus=0 deptocheck="${javaversion}" unset javacheck - elif [ -n "$(command -v apt-get)" ]; then - dpkg-query -W -f='${Status}' ${deptocheck} 2>/dev/null | grep -q -P '^install ok installed$' + elif [ "${deptocheck}" == "jq" ]&&[ "${distroversion}" == "6" ]; then + jqstatus=1 + elif [ "${deptocheck}" == "jq" ]&&[ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "18.04" ]&& ! grep -qE "^deb .*universe" /etc/apt/sources.list; then + # #1985 ubuntu 18.04.1 bug does not set sources.list correctly which means universe is not active by default + # If the universe repo does not exist, mark as dependency missing and universe missing. + 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 [ -n "$(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 [ -n "$(command -v yum)" ]; then - yum -q list installed ${deptocheck} > /dev/null 2>&1 + elif [ -n "$(command -v rpm 2>/dev/null)" ]; then + rpm -q "${deptocheck}" > /dev/null 2>&1 depstatus=$? fi if [ "${depstatus}" == "0" ]; then - # if dependency is found + # If dependency is found. missingdep=0 if [ "${function_selfname}" == "command_install.sh" ]; then echo -e "${green}${deptocheck}${default}" - sleep 0.5 + fn_sleep_time fi else - # if dependency is not found + # If dependency is not found. missingdep=1 if [ "${function_selfname}" == "command_install.sh" ]; then echo -e "${red}${deptocheck}${default}" - sleep 0.5 + fn_sleep_time + fi + # Define required dependencies for SteamCMD. + if [ -n "${appid}" ]; then + if [ "${deptocheck}" == "glibc.i686" ]||[ "${deptocheck}" == "libstdc++64.i686" ]||[ "${deptocheck}" == "lib32gcc1" ]||[ "${deptocheck}" == "libstdc++6:i386" ]; then + steamcmdfail=1 + fi fi fi - # Missing dependencies are added to array_deps_missing + # Missing dependencies are added to array_deps_missing. if [ "${missingdep}" == "1" ]; then array_deps_missing+=("${deptocheck}") fi } fn_deps_email(){ - # Adds postfix to required dependencies if email alert is enabled + # Adds postfix to required dependencies if email alert is enabled. if [ "${emailalert}" == "on" ]; then if [ -f /usr/bin/mailx ]; then if [ -d /etc/exim4 ]; then array_deps_required+=( exim4 ) elif [ -d /etc/sendmail ]; then array_deps_required+=( sendmail ) - elif [ -n "$(command -v dpkg-query)" ]; then + elif [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then array_deps_required+=( mailutils postfix ) - elif [ -n "$(command -v yum)" ]; then + elif [ -n "$(command -v rpm 2>/dev/null)" ]; then array_deps_required+=( mailx postfix ) fi else - if [ -n "$(command -v dpkg-query)" ]; then + if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then array_deps_required+=( mailutils postfix ) - elif [ -n "$(command -v yum)" ]; then + elif [ -n "$(command -v rpm 2>/dev/null)" ]; then array_deps_required+=( mailx postfix ) fi fi @@ -75,12 +226,22 @@ fn_deps_email(){ fn_found_missing_deps(){ if [ "${#array_deps_missing[@]}" != "0" ]; then - fn_print_dots "Checking dependencies" - sleep 0.5 - fn_print_error_nl "Checking dependencies: missing: ${red}${array_deps_missing[@]}${default}" - fn_script_log_error "Checking dependencies: missing: ${red}${array_deps_missing[@]}${default}" - sleep 1 - sudo -v > /dev/null 2>&1 + + fn_print_warning_nl "Missing dependencies: ${red}${array_deps_missing[@]}${default}" + fn_script_log_warn "Missing dependencies: ${array_deps_missing[@]}" + fn_sleep_time + if [ -n "${monostatus}" ]; then + fn_install_mono_repo + fi + if [ -n "${jqstatus}" ]; then + fn_print_warning_nl "jq is not available in the ${distroname} repository" + echo " * https://docs.linuxgsm.com/requirements/jq" + 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." @@ -91,16 +252,35 @@ fn_found_missing_deps(){ echo -en "...\r" sleep 1 echo -en " \r" - if [ -n "$(command -v dpkg-query)" ]; then - cmd="sudo dpkg --add-architecture i386; sudo apt-get -y install ${array_deps_missing[@]}" - eval ${cmd} - elif [ -n "$(command -v yum)" ]; then + if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then + cmd="sudo dpkg --add-architecture i386; sudo apt update; sudo apt -y install ${array_deps_missing[@]}" + eval "${cmd}" + elif [ -n "$(command -v dnf 2>/dev/null)" ]; then + cmd="sudo dnf -y install ${array_deps_missing[@]}" + eval "${cmd}" + elif [ -n "$(command -v yum 2>/dev/null)" ]; then cmd="sudo yum -y install ${array_deps_missing[@]}" - eval ${cmd} + eval "${cmd}" fi if [ $? != 0 ]; then fn_print_failure_nl "Unable to install dependencies" fn_script_log_fatal "Unable to install dependencies" + echo "" + fn_print_warning_nl "Manually install dependencies." + fn_script_log_warn "Manually install dependencies." + if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then + echo " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}" + elif [ -n "$(command -v dnf 2>/dev/null)" ]; then + echo " sudo dnf install ${array_deps_missing[@]}" + elif [ -n "$(command -v yum 2>/dev/null)" ]; then + echo " sudo yum install ${array_deps_missing[@]}" + fi + if [ "${steamcmdfail}" ]; then + echo "" + fn_print_failure_nl "Missing dependencies required to run SteamCMD." + fn_script_log_fatal "Missing dependencies required to run SteamCMD." + core_exit.sh + fi else fn_print_complete_nl "Install dependencies completed" fn_script_log_pass "Install dependencies completed" @@ -109,57 +289,62 @@ fn_found_missing_deps(){ echo "" fn_print_warning_nl "$(whoami) does not have sudo access. Manually install dependencies." fn_script_log_warn "$(whoami) does not have sudo access. Manually install dependencies." - if [ -n "$(command -v dpkg-query)" ]; then - echo " sudo dpkg --add-architecture i386; sudo apt-get install ${array_deps_missing[@]}" - elif [ -n "$(command -v yum)" ]; then + if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then + echo " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}" + elif [ -n "$(command -v dnf 2>/dev/null)" ]; then + echo " sudo dnf install ${array_deps_missing[@]}" + elif [ -n "$(command -v yum 2>/dev/null)" ]; then echo " sudo yum install ${array_deps_missing[@]}" fi + if [ "${steamcmdfail}" ]; then + echo "" + fn_print_failure_nl "Missing dependencies required to run SteamCMD." + fn_script_log_fatal "Missing dependencies required to run SteamCMD." + core_exit.sh + fi echo "" fi if [ "${function_selfname}" == "command_install.sh" ]; then sleep 5 fi + else + if [ "${function_selfname}" == "command_install.sh" ]; 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 + # Loop though required depenencies. for deptocheck in "${array_deps_required[@]}" do fn_deps_detector done - # user to be informed of any missing dependencies + # user to be informed of any missing dependencies. fn_found_missing_deps } -info_distro.sh - -if [ "${function_selfname}" == "command_install.sh" ]; then - echo "" - echo "Checking Dependencies" - echo "=================================" -fi - -# Check will only run if using apt-get or yum -if [ -n "$(command -v dpkg-query)" ]; then - # Generate array of missing deps +# Generate require dependencies for debian based systems. +fn_deps_build_debian(){ + # Generate array of missing deps. array_deps_missing=() - # LGSM requirements - array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python bzip2 gzip ) + # LinuxGSM requirements. + array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python bzip2 gzip unzip binutils bc jq ) - # All servers except ts3 require tmux - if [ "${gamename}" != "TeamSpeak 3" ]; then - if [ "$(command -v tmux)" ]||[ "$(which tmux 2>/dev/null)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then + # All servers except ts3 require tmux. + if [ "${shortname}" != "ts3" ]; then + if [ "$(command -v tmux 2>/dev/null)" ]; then tmuxcheck=1 # Added for users compiling tmux from source to bypass check. else array_deps_required+=( tmux ) fi fi - # All servers except ts3,mumble and minecraft servers require libstdc++6 and lib32gcc1 - if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${engine}" != "lwjgl2" ]; then + # All servers except ts3, mumble, GTA and minecraft servers require libstdc++6 and lib32gcc1. + if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${engine}" != "renderware" ]; then if [ "${arch}" == "x86_64" ]; then array_deps_required+=( lib32gcc1 libstdc++6:i386 ) else @@ -167,115 +352,185 @@ if [ -n "$(command -v dpkg-query)" ]; then fi fi - # Game Specific requirements + # Game Specific requirements. - # Spark - if [ "${engine}" == "spark" ]; then + # 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 [ "${gamename}" == "7 Days To Die" ]; then + elif [ "${shortname}" == "sdtd" ]; then array_deps_required+=( telnet expect ) # No More Room in Hell, Counter-Strike: Source and Garry's Mod - elif [ "${gamename}" == "No More Room in Hell" ]||[ "${gamename}" == "Counter-Strike: Source" ]||[ "${gamename}" == "Garry's Mod" ]; then + elif [ "${shortname}" == "nmrih" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "zps" ]; then if [ "${arch}" == "x86_64" ]; then array_deps_required+=( lib32tinfo5 ) else array_deps_required+=( libtinfo5 ) fi - # Brainbread 2 and Don't Starve Together - elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then + # Brainbread 2 ,Don't Starve Together & Team Fortress 2 + elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then array_deps_required+=( libcurl4-gnutls-dev:i386 ) + if [ "${shortname}" == "tf2" ]; then + array_deps_required+=( libtcmalloc-minimal4:i386 ) + fi # Battlefield: 1942 - elif [ "${gamename}" == "Battlefield: 1942" ]; then + elif [ "${shortname}" == "bf1942" ]; then array_deps_required+=( libncurses5:i386 ) # Call of Duty - elif [ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty 2" ]; then + elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]; then array_deps_required+=( libstdc++5:i386 ) - # Project Zomboid and Minecraft - elif [ "${engine}" == "projectzomboid" ]||[ "${engine}" == "lwjgl2" ]; then + # Factorio + elif [ "${shortname}" == "fctr" ]; then + array_deps_required+=( xz-utils ) + # Hurtword/Rust + elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then + array_deps_required+=( lib32z1 ) + # Minecraft + elif [ "${shortname}" == "mc" ]; then javaversion=$(java -version 2>&1 | grep "version") - if [ -n "${javaversion}" ]; then - javacheck=1 # Added for users using Oracle JRE to bypass the check. + if [ "${javaversion}" ]; then + # Added for users using Oracle JRE to bypass the check. + javacheck=1 + else + array_deps_required+=( openjdk-8-jre-headless ) + fi + # Project Zomboid + elif [ "${shortname}" == "pz" ]; then + if [ -n "$(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 ) + array_deps_required+=( default-jre rng-tools ) fi # GoldenEye: Source - elif [ "${gamename}" == "GoldenEye: Source" ]; then + elif [ "${shortname}" == "ges" ]; then array_deps_required+=( zlib1g:i386 libldap-2.4-2:i386 ) + # Serious Sam 3: BFE + elif [ "${shortname}" == "ss3" ]; then + array_deps_required+=( libxrandr2:i386 libglu1-mesa:i386 libxtst6:i386 libusb-1.0-0-dev:i386 libxxf86vm1:i386 libopenal1:i386 libssl1.0.0:i386 libgtk2.0-0:i386 libdbus-glib-1-2:i386 libnm-glib-dev:i386 ) + # Sven Co-op + elif [ "${shortname}" == "sven" ]; then + array_deps_required+=( libssl1.0.0:i386 zlib1g:i386 ) # Unreal Engine - elif [ "${executable}" == "./ucc-bin" ]; then - #UT2K4 + elif [ "${executable}" == "./ucc-bin" ]; then + # UT2K4 if [ -f "${executabledir}/ut2004-bin" ]; then - array_deps_required+=( libsdl1.2debian libstdc++5:i386 bzip2 ) - #UT99 + array_deps_required+=( libsdl1.2debian libstdc++5:i386 ) + # UT99 else - array_deps_required+=( libsdl1.2debian bzip2 ) + array_deps_required+=( libsdl1.2debian ) fi # Unreal Tournament - elif [ "${gamename}" == "Unreal Tournament" ]; then + elif [ "${shortname}" == "ut" ]; then array_deps_required+=( unzip ) + # Eco + elif [ "${shortname}" == "eco" ]; then + array_deps_required+=( mono-complete ) + # Wurm: Unlimited + elif [ "${shortname}" == "wurm" ]; then + array_deps_required+=( xvfb ) fi fn_deps_email fn_check_loop +} -elif [ -n "$(command -v yum)" ]; then - # Generate array of missing deps +fn_deps_build_redhat(){ + # Generate array of missing deps. array_deps_missing=() - # LGSM requirements + # LinuxGSM requirements. + # CentOS 6 if [ "${distroversion}" == "6" ]; then - array_deps_required=( curl wget util-linux-ng python file gzip bzip2 ) + array_deps_required=( epel-release curl wget util-linux-ng python file gzip bzip2 unzip binutils bc jq ) + elif [ "${distroversion}" == "7" ]; then + array_deps_required=( epel-release curl wget util-linux python file gzip bzip2 unzip binutils bc jq ) + elif [ "${distroid}" == "fedora" ]; then + array_deps_required=( curl wget util-linux python2 file gzip bzip2 unzip binutils bc jq ) + elif [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then + array_deps_required=( curl wget util-linux python27 file gzip bzip2 unzip binutils bc jq ) else - array_deps_required=( curl wget util-linux python file gzip bzip2 ) + array_deps_required=( curl wget util-linux python file gzip bzip2 unzip binutils bc jq ) fi - # All servers except ts3 require tmux - if [ "${gamename}" != "TeamSpeak 3" ]; then - if [ "$(command -v tmux)" ]||[ "$(which tmux 2>/dev/null)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then - tmuxcheck=1 # Added for users compiling tmux from source to bypass check. + # All servers except ts3 require tmux. + if [ "${shortname}" != "ts3" ]; then + if [ "$(command -v tmux 2>/dev/null)" ]; then + # Added for users compiling tmux from source to bypass check. + tmuxcheck=1 else array_deps_required+=( tmux ) fi fi - # All servers except ts3,mumble and minecraft servers require glibc.i686 and libstdc++.i686 - if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${engine}" != "lwjgl2" ]; then - array_deps_required+=( glibc.i686 libstdc++.i686 ) + # All servers except ts3, mumble, multi theft auto and minecraft servers require glibc.i686 and libstdc++.i686. + if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${engine}" != "renderware" ]; then + if [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then + array_deps_required+=( glibc.i686 libstdc++64.i686 ) + else + array_deps_required+=( glibc.i686 libstdc++.i686 ) + fi fi - # Game Specific requirements + # Game Specific requirements. - # Spark - if [ "${engine}" == "spark" ]; then + # 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 [ "${gamename}" == "7 Days To Die" ]; then + elif [ "${shortname}" == "sdtd" ]; then array_deps_required+=( telnet expect ) - # No More Room in Hell, Counter-Strike: Source and Garry's Mod - elif [ "${gamename}" == "No More Room in Hell" ]||[ "${gamename}" == "Counter-Strike: Source" ]||[ "${gamename}" == "Garry's Mod" ]; then + # No More Room in Hell, Counter-Strike: Source, Garry's Mod and Zombie Panic: Source + elif [ "${shortname}" == "nmrih" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "zps" ]; then array_deps_required+=( ncurses-libs.i686 ) - # Brainbread 2 and Don't Starve Together - elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then + # Brainbread 2, Don't Starve Together & Team Fortress 2 + elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then array_deps_required+=( libcurl.i686 ) + if [ "${shortname}" == "tf2" ]; then + array_deps_required+=( gperftools-libs.i686 ) + fi # Battlefield: 1942 - elif [ "${gamename}" == "Battlefield: 1942" ]; then + elif [ "${shortname}" == "bf1942" ]; then array_deps_required+=( ncurses-libs.i686 ) # Call of Duty - elif [ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty 2" ]; then + elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]; then array_deps_required+=( compat-libstdc++-33.i686 ) - # Project Zomboid and Minecraft - elif [ "${engine}" == "projectzomboid" ]||[ "${engine}" == "lwjgl2" ]; then + # Factorio + elif [ "${shortname}" == "fctr" ]; then + array_deps_required+=( xz ) + elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then + array_deps_required+=( zlib-devel ) + # Minecraft + elif [ "${shortname}" == "mc" ]; then javaversion=$(java -version 2>&1 | grep "version") - if [ -n "${javaversion}" ]; then - javacheck=1 # Added for users using Oracle JRE to bypass the check. + if [ "${javaversion}" ]; then + # Added for users using Oracle JRE to bypass the check. + javacheck=1 + array_deps_required+=( rng-tools ) else - array_deps_required+=( java-1.8.0-openjdk ) + array_deps_required+=( java-1.8.0-openjdk rng-tools ) + fi + # Project Zomboid & Minecraft + elif [ "${shortname}" == "pz" ]; then + javaversion=$(java -version 2>&1 | grep "version") + if [ "${javaversion}" ]; then + # Added for users using Oracle JRE to bypass the check. + javacheck=1 + array_deps_required+=( rng-tools ) + else + array_deps_required+=( java-1.8.0-openjdk rng-tools ) fi # GoldenEye: Source - elif [ "${gamename}" == "GoldenEye: Source" ]; then + elif [ "${shortname}" == "ges" ]; then array_deps_required+=( zlib.i686 openldap.i686 ) # Unreal Engine - elif [ "${executable}" == "./ucc-bin" ]; then + elif [ "${executable}" == "./ucc-bin" ]; then #UT2K4 if [ -f "${executabledir}/ut2004-bin" ]; then array_deps_required+=( compat-libstdc++-33.i686 SDL.i686 bzip2 ) @@ -284,9 +539,37 @@ elif [ -n "$(command -v yum)" ]; then array_deps_required+=( SDL.i686 bzip2 ) fi # Unreal Tournament - elif [ "${gamename}" == "Unreal Tournament" ]; then + elif [ "${shortname}" == "ut" ]; then array_deps_required+=( unzip ) + # Eco + elif [ "${shortname}" == "eco" ]; then + array_deps_required+=( mono-complete ) fi fn_deps_email fn_check_loop +} + +if [ "${function_selfname}" == "command_install.sh" ]; then + if [ "$(whoami)" == "root" ]; then + echo "" + echo "Checking Dependencies as root" + echo "=================================" + 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 "" + echo "Checking Dependencies" + echo "=================================" + 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 100644 index 000000000..f0f0a67b7 --- /dev/null +++ b/lgsm/functions/check_executable.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LinuxGSM check_executable.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Checks if server executable exists. + +local commandname="CHECK" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Check if executable exists +if [ ! -f "${executabledir}/${execname}" ]; then + fn_print_fail_nl "executable was not found" + echo "* ${executabledir}/${execname}" + 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 index a5e5c95a0..4ff80b84b 100644 --- a/lgsm/functions/check_glibc.sh +++ b/lgsm/functions/check_glibc.sh @@ -1,41 +1,28 @@ #!/bin/bash -# LGSM check_glibc.sh function +# LinuxGSM check_glibc.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com -# Description: Checks if the server has the correct Glibc version or a fix available. +# Website: https://linuxgsm.com +# Description: Checks if the server has the correct Glibc version. local commandname="CHECK" -info_glibc.sh info_distro.sh -if [ "${glibcrequired}" == "NOT REQUIRED" ]; then +if [ "${glibc}" == "null" ]; then + # Glibc is not required. : -elif [ "${glibcrequired}" == "UNKNOWN" ]; then - fn_print_dots "Glibc fix" - sleep 0.5 - fn_print_error_nl "Glibc fix: ${red}${glibcrequired}${default}" - echo -e " * glibc required: ${red}${glibcrequired}${default}" - echo -e " * glibc installed: ${glibcversion}" -elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then - if [ "${glibcfix}" == "yes" ]; then - if [ "${function_selfname}" != "command_install.sh" ]; then - fn_print_dots "Glibc fix" - sleep 0.5 - fn_print_info_nl "Glibc fix: ${green}Using Glibc fix${default}" - echo -e " * glibc required: ${red}${glibcrequired}${default}" - echo -e " * glibc installed: ${glibcversion}" - fix_glibc.sh - fi - else - fn_print_dots "Glibc fix" - sleep 0.5 - fn_print_error_nl "Glibc fix: ${red}No Glibc fix available!${default}" - echo -en "\n" - echo -e " * glibc required: ${glibcrequired}" - echo -e " * glibc installed: ${red}${glibcversion}${default}" - echo -en "\n" - fn_print_information "The game server will probably not work. A distro upgrade is required!" - sleep 2 - fi -fi \ No newline at end of file +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 index 8141c534e..b54dddd16 100644 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -1,47 +1,88 @@ #!/bin/bash -# LGSM check_ip.sh function +# LinuxGSM check_ip.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# 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". local commandname="CHECK" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travistest}" != "1" ]; then +if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${travistest}" != "1" ]; then if [ ! -f "/bin/ip" ]; then ipcommand="/sbin/ip" else ipcommand="ip" fi - getip=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|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) + getip=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|sort -u|grep -v 127.0.0) + getipwc=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|sort -u|grep -vc 127.0.0) info_config.sh + info_parms.sh + + # IP is not set to specific IP. if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then + fn_print_dots "Check IP" + # Multiple interfaces. if [ "${getipwc}" -ge "2" ]; then - fn_print_dots "Check IP" - sleep 1 - fn_print_fail "Check IP: Multiple active network interfaces found." - sleep 1 + if [ "${function_selfname}" == "command_details.sh" ]; then + fn_print_warn "Check IP: Multiple IP addresses found." + else + fn_print_fail "Check IP: Multiple IP addresses found." + fi echo -en "\n" + # IP is set within game config. if [ "${ipsetinconfig}" == "1" ]; then - fn_print_information "Specify the IP you want to use within the server config file ${servercfg}.\n" - echo -en "${servercfgfullpath}\n" + fn_print_information "Specify the IP you want to bind within ${servercfg}.\n" + echo -en " * location: ${servercfgfullpath}\n" + echo -en "\n" echo -en "Set ${ipinconfigvar} to one of the following:\n" + fn_script_log_fatal "Multiple IP addresses found." + fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}." + # IP is set within LinuxGSM config. else - fn_print_information "Specify the IP you want to use within the ${selfname} script.\n" + fn_print_information_nl "Specify the IP you want to bind within a LinuxGSM config file.\n" + echo -en " * location: ${configdirserver}\n" + echo -en "\n" echo -en "Set ip=\"0.0.0.0\" to one of the following:\n" + fn_script_log_fatal "Multiple IP addresses found." + if [ "${legacymode}" == "1" ]; then + fn_script_log_fatal "Specify the IP you want to bind within the ${selfname} script." + else + fn_script_log_fatal "Specify the IP you want to bind within: ${configdirserver}." + fi fi echo -en "${getip}\n" + echo -en "\n" + echo -en "https://linuxgsm.com/network-interfaces\n" echo -en "" - echo -en "https://gameservermanagers.com/network-interfaces\n" + # Do not exit for details and postdetails commands. + if [ "${function_selfname}" != "command_details.sh" ]||[ "${function_selfname}" != "command_postdetails.sh" ]; then + fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n" + core_exit.sh + else + ip="NOT SET" + fi + # Single interface. + elif [ "${ipsetinconfig}" == "1" ]; then + fn_print_fail "Check IP: IP address not set in game config." + echo -en "\n" + fn_print_information "Specify the IP you want to bind within ${servercfg}.\n" + echo -en " * location: ${servercfgfullpath}\n" + echo -en "\n" + echo -en "Set ${ipinconfigvar} to the following:\n" + echo -en "${getip}\n" + echo -en "\n" + echo -en "https://linuxgsm.com/network-interfaces\n" echo -en "" - fn_script_log_fatal "Multiple active network interfaces found." - fn_script_log_fatal "Manually specify the IP you want to use within the ${selfname} script." - fn_script_log_fatal "https://gameservermanagers.com/network-interfaces\n" - core_exit.sh + fn_script_log_fatal "IP address not set in game config." + fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}." + fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n" + if [ "${function_selfname}" != "command_details.sh" ];then + core_exit.sh + fi else - ip=${getip} + fn_print_info_nl "Check IP: ${getip}" + fn_script_log_info "IP automatically set as: ${getip}" + ip="${getip}" fi fi fi diff --git a/lgsm/functions/check_logs.sh b/lgsm/functions/check_logs.sh index 5bd69bb0f..9f3e87427 100644 --- a/lgsm/functions/check_logs.sh +++ b/lgsm/functions/check_logs.sh @@ -1,17 +1,26 @@ #!/bin/bash -# LGSM check_logs.sh function +# LinuxGSM check_logs.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Checks if log files exist. local commandname="CHECK" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# Create directories for the script and console logs -if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "TeamSpeak 3" ]; then +fn_check_logs(){ fn_print_dots "Checking for log files" - sleep 0.5 fn_print_info_nl "Checking for log files: Creating log files" checklogs=1 install_logs.sh +} + +# Create directories for the script and console logs. +if [ ! -d "${lgsmlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${shortname}" != "ts3" ]; then + fn_check_logs +fi + +# Create gamelogdir. +# If variable exists gamelogdir exists and log/server does not. +if [ -n "${gamelogdir}" ]&&[ -d "${gamelogdir}" ]&&[ ! -d "${logdir}/server" ]; then + fn_check_logs fi diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index 1411e649c..77dfd1b5b 100644 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -1,26 +1,25 @@ #!/bin/bash -# LGSM check_permissions.sh +# LinuxGSM check_permissions.sh # Author: Daniel Gibbs # Contributor: UltimateByte -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Checks ownership & permissions of scripts, files and directories. local commandname="CHECK" -local function_selfname="$(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 + if [ "$(find "${rootdir}/${selfname}" -not -user $(whoami) | wc -l)" -ne "0" ]; then selfownissue=1 fi fi if [ -d "${functionsdir}" ]; then - if [ $(find "${functionsdir}" -not -user $(whoami)|wc -l) -ne "0" ]; then + if [ "$(find "${functionsdir}" -not -user $(whoami) | wc -l)" -ne "0" ]; then funcownissue=1 fi fi - if [ -d "${filesdir}" ]; then - if [ $(find "${filesdir}" -not -user $(whoami)|wc -l) -ne "0" ]; then + if [ -d "${serverfiles}" ]; then + if [ "$(find "${serverfiles}" -not -user $(whoami) | wc -l)" -ne "0" ]; then filesownissue=1 fi fi @@ -32,26 +31,30 @@ fn_check_ownership(){ { echo -e "User\tGroup\tFile\n" if [ "${selfownissue}" == "1" ]; then - find "${rootdir}/${selfname}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" + find "${rootdir}/${selfname}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n" fi if [ "${funcownissue}" == "1" ]; then - find "${functionsdir}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" + find "${functionsdir}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n" fi if [ "${filesownissue}" == "1" ]; then - find "${filesdir}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" + find "${serverfiles}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n" fi - } | column -s $'\t' -t | tee -a "${scriptlog}" + } | column -s $'\t' -t | tee -a "${lgsmlog}" echo "" - fn_print_information_nl "For more information, please see https://github.com/GameServerManagers/LinuxGSM/wiki/FAQ#-fail--starting-game-server-ownership-issues-found" - fn_script_log "For more information, please see https://github.com/GameServerManagers/LinuxGSM/wiki/FAQ#-fail--starting-game-server-ownership-issues-found" + 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 + 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:" @@ -59,42 +62,50 @@ fn_check_permissions(){ { echo -e "File\n" find "${functionsdir}" -type f -not -executable -printf "%p\n" - } | column -s $'\t' -t | tee -a "${scriptlog}" + } | column -s $'\t' -t | tee -a "${lgsmlog}" + if [ "${monitorflag}" == 1 ]; then + alert="permissions" + alert.sh + fi core_exit.sh fi fi - # Check rootdir permissions + # Check rootdir permissions. if [ -n "${rootdir}" ]; then - # Get permission numbers on directory under the form 775 + # Get permission numbers on directory under the form 775. rootdirperm="$(stat -c %a "${rootdir}")" - # Grab the first and second digit for user and group permission + # Grab the first and second digit for user and group permission. userrootdirperm="${rootdirperm:0:1}" grouprootdirperm="${rootdirperm:1:1}" - if [ "${userrootdirperm}" != "7" ] && [ "${grouprootdirperm}" != "7" ]; then + 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 + # Check if executable is executable and attempt to fix it. + # First get executable name. execname="$(basename "${executable}")" if [ -f "${executabledir}/${execname}" ]; then - # Get permission numbers on file under the form 775 + # Get permission numbers on file under the form 775. execperm="$(stat -c %a "${executabledir}/${execname}")" - # Grab the first and second digit for user and group permission + # Grab the first and second digit for user and group permission. userexecperm="${execperm:0:1}" groupexecperm="${execperm:1:1}" - # Check for invalid user permission - 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 + # 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:" @@ -103,21 +114,25 @@ fn_check_permissions(){ fn_script_log_info "${executabledir}/${execname}" fn_print_information_nl "Applying chmod u+x,g+x ${executabledir}/${execname}" fn_script_log_info "Applying chmod u+x,g+x ${execperm}" - # Make the executable executable + # Make the executable executable. chmod u+x,g+x "${executabledir}/${execname}" - # Second check to see if it's been successfully applied - # Get permission numbers on file under the form 775 + # Second check to see if it's been successfully applied. + # Get permission numbers on file under the form 775. execperm="$(stat -c %a "${executabledir}/${execname}")" - # Grab the first and second digit for user and group permission + # Grab the first and second digit for user and group permission. userexecperm="${execperm:0:1}" groupexecperm="${execperm:1:1}" - if [ "${userexecperm}" == "0" ] || [ "${userexecperm}" == "2" ] || [ "${userexecperm}" == "4" ] || [ "${userexecperm}" == "6" ]; then - if [ "${groupexecperm}" == "0" ] || [ "${groupexecperm}" == "2" ] || [ "${groupexecperm}" == "4" ] || [ "${groupexecperm}" == "6" ]; then - # If errors are still found + if [ "${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 @@ -126,5 +141,96 @@ fn_check_permissions(){ fi } -fn_check_ownership -fn_check_permissions +## 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 "" + fn_print_information_nl "This error causes servers to fail starting properly" + fn_script_log_info "This error causes servers to fail starting properly." + echo " * To fix this issue, run the following command as root:" + fn_script_log_info "To fix this issue, run the following command as root:" + echo " 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(){ + sudo -n true > /dev/null 2>&1 + if [ $? -eq 0 ]; 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 [ "${function_selfname}" == "command_start.sh" ]; then + fn_sys_perm_error_process + fi +fi diff --git a/lgsm/functions/check_root.sh b/lgsm/functions/check_root.sh index 70067f5e5..b5d20cf24 100644 --- a/lgsm/functions/check_root.sh +++ b/lgsm/functions/check_root.sh @@ -1,16 +1,18 @@ #!/bin/bash -# LGSM check_root.sh function +# LinuxGSM check_root.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Checks if the user tried to run the script as root. local commandname="CHECK" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ $(whoami) = "root" ]; then - fn_print_fail_nl "Do NOT run this script as root!" - if [ -d "${scriptlogdir}" ]; then - fn_script_log_fatal "${selfname} attempted to run as root." +if [ "$(whoami)" = "root" ]; then + if [ "${function_selfname}" != "command_install.sh" ]; 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 - core_exit.sh fi diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh index 4a8a381b4..529dcbf5b 100644 --- a/lgsm/functions/check_status.sh +++ b/lgsm/functions/check_status.sh @@ -1,36 +1,24 @@ #!/bin/bash -# LGSM check_status.sh function +# LinuxGSM check_status.sh function # Author: Daniel Gibbs # Contributor: UltimateByte -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Checks the process status of the server. Either online or offline. local commandname="CHECK" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ "${gamename}" == "TeamSpeak 3" ]; then +if [ "${shortname}" == "ts3" ]; then # 1: Server is running # 0: Server seems to have died # 0: No server running (ts3server.pid is missing) - status=$(${executabledir}/ts3server_startscript.sh status servercfgfullpathfile=${servercfgfullpath}) + status=$("${executabledir}/ts3server_startscript.sh" status servercfgfullpathfile="${servercfgfullpath}") if [ "${status}" == "Server is running" ]; then status=1 else ts3error="${status}" status=0 fi - -elif [ "${gamename}" == "Mumble" ]; then - # Get config info - info_config.sh - # 1: Server is listening - # 0: Server is not listening, considered closed - mumblepid=$(netstat -nap 2>/dev/null | grep udp | grep ${port} | grep murmur | awk '{ print $6 }' | awk -F'/' '{ print $1 }') - if [ -z "${mumblepid}" ]; then - status=0 - else - status=1 - fi else - status=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:") + status=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${servicename}") fi diff --git a/lgsm/functions/check_steamcmd.sh b/lgsm/functions/check_steamcmd.sh index 20a36afea..2972ae71d 100644 --- a/lgsm/functions/check_steamcmd.sh +++ b/lgsm/functions/check_steamcmd.sh @@ -1,14 +1,14 @@ #!/bin/bash -# LGSM check_steamcmd.sh function +# LinuxGSM check_steamcmd.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Checks if SteamCMD is installed correctly. local commandname="CHECK" fn_install_steamcmd(){ if [ ! -d "${steamcmddir}" ]; then - mkdir -v "${steamcmddir}" + mkdir -pv "${steamcmddir}" fi fn_fetch_file "http://media.steampowered.com/client/steamcmd_linux.tar.gz" "${tmpdir}" "steamcmd_linux.tar.gz" fn_dl_extract "${tmpdir}" "steamcmd_linux.tar.gz" "${steamcmddir}" @@ -18,35 +18,40 @@ fn_install_steamcmd(){ fn_check_steamcmd_user(){ # Checks if steamuser is setup. if [ "${steamuser}" == "username" ]; then - fn_print_fail_nl "Steam login not set. Update steamuser in ${selfname}." + if [ "${legacymode}" == "1" ]; then + fn_print_fail_nl "Steam login not set. Update steamuser in ${selfname}" + else + fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}" + fi echo " * Change steamuser=\"username\" to a valid steam login." - if [ -d "${scriptlogdir}" ]; then - fn_script_log_fatal "Steam login not set. Update steamuser in ${selfname}." + if [ -d "${lgsmlogdir}" ]; then + if [ "${legacymode}" == "1" ]; then + fn_script_log_fatal "Steam login not set. Update steamuser in ${selfname}" + else + fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}" + fi fi core_exit.sh fi - # Anonymous user is set if steamuser is missing + # Anonymous user is set if steamuser is missing. if [ -z "${steamuser}" ]; then - if [ -d "${scriptlogdir}" ]; then - fn_script_log_info "Using anonymous Steam login." + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_info "Using anonymous Steam login" fi steamuser="anonymous" - steampass="" - sleep 1 + steampass='' fi } fn_check_steamcmd_sh(){ # Checks if SteamCMD exists when starting or updating a server. # Installs if missing. - steamcmddir="${rootdir}/steamcmd" if [ ! -f "${steamcmddir}/steamcmd.sh" ]; then if [ "${function_selfname}" == "command_install.sh" ]; then fn_install_steamcmd else fn_print_error_nl "SteamCMD is missing" fn_script_log_error "SteamCMD is missing" - sleep 1 fn_install_steamcmd fi elif [ "${function_selfname}" == "command_install.sh" ]; then @@ -55,17 +60,5 @@ fn_check_steamcmd_sh(){ fi } -fn_check_steamcmd_guard(){ - if [ "${function_selfname}" == "command_update.sh" ]||[ "${function_selfname}" == "command_validate.sh" ]; then - # Checks that SteamCMD is working correctly and will prompt Steam Guard if required. - "${steamcmddir}"/steamcmd.sh +login "${steamuser}" "${steampass}" +quit - if [ $? -ne 0 ]; then - fn_print_failure_nl "Error running SteamCMD" - fi - fi -} - fn_check_steamcmd_user fn_check_steamcmd_sh -# stdbuf has now replaced unbuffer. This should not longer be required. -#fn_check_steamcmd_guard diff --git a/lgsm/functions/check_system_dir.sh b/lgsm/functions/check_system_dir.sh index d06cbba05..0a10b15ac 100644 --- a/lgsm/functions/check_system_dir.sh +++ b/lgsm/functions/check_system_dir.sh @@ -1,16 +1,23 @@ #!/bin/bash -# LGSM check_system_dir.sh function +# LinuxGSM check_system_dir.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com -# Description: Checks if systemdir is accessible. +# Website: https://linuxgsm.com +# Description: Checks if systemdir/serverfiles is accessible. local commandname="CHECK" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ ! -d "${systemdir}" ]; then - fn_print_fail_nl "Cannot access ${systemdir}: No such directory" - if [ -d "${scriptlogdir}" ]; then - fn_script_log_fatal "Cannot access ${systemdir}: No such directory." +if [ "${function_selfname}" != "command_validate.sh" ]; 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 index 3040a8406..bc2317f48 100644 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -1,26 +1,39 @@ #!/bin/bash -# LGSM check_system_requirements.sh +# LinuxGSM check_system_requirements.sh # Author: Daniel Gibbs # Contributor: UltimateByte -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Checks RAM requirements local commandname="CHECK" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_distro.sh # RAM requirements in megabytes for each game or engine. -if [ "${gamename}" == "Rust" ]; then + +if [ "${shortname}" == "ark" ]; then + ramrequirementmb="4000" + ramrequirementgb="4" +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 [ "${gamename}" == "ARMA 3" ]; then +elif [ "${shortname}" == "mc" ]; then ramrequirementmb="1000" ramrequirementgb="1" -elif [ "${gamename}" == "Minecraft" ]; then +elif [ "${shortname}" == "pstbs" ]; then + ramrequirementmb="2000" + ramrequirementgb="2" +elif [ "${shortname}" == "ns2" ]||[ "${shortname}" == "ns2c" ]; then ramrequirementmb="1000" ramrequirementgb="1" -elif [ "${gamename}" == "Natural Selection 2" ]||[ "${gamename}" == "NS2: Combat" ]; then +elif [ "${shortname}" == "st" ]; then ramrequirementmb="1000" ramrequirementgb="1" fi @@ -29,11 +42,9 @@ fi if [ -n "${ramrequirementmb}" ]; then if [ "${physmemtotalmb}" -lt "${ramrequirementmb}" ]; then fn_print_dots "Check RAM" - sleep 0.5 - # Warn the user + # Warn the user. fn_print_warn_nl "Check RAM: ${ramrequirementgb}G required, ${physmemtotal} available" - sleep 1 echo " * ${gamename} server may fail to run or experience poor performance." - sleep 1 + fn_sleep_time fi fi diff --git a/lgsm/functions/check_tmuxception.sh b/lgsm/functions/check_tmuxception.sh index 5b906f53e..1a13bef9c 100644 --- a/lgsm/functions/check_tmuxception.sh +++ b/lgsm/functions/check_tmuxception.sh @@ -1,29 +1,30 @@ #!/bin/bash -# LGSM check_config.sh function +# LinuxGSM check_config.sh function # Author: Daniel Gibbs # Contributor: UltimateByte -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Checks if run from tmux or screen -local commandname="check" +local commandname="CHECK" fn_check_is_in_tmux(){ - if [ -n "${TMUX}" ];then + if [ -n "${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 "LGSM creates a tmux session when starting the server." + fn_print_information_nl "LinuxGSM creates a tmux session when starting the server." echo "It is not possible to run a tmux session inside another tmux session" - echo "https://github.com/GameServerManagers/LinuxGSM/wiki/Tmux#tmuxception" + echo "https://docs.linuxgsm.com/requirements/tmux#tmuxception" core_exit.sh fi } + fn_check_is_in_screen(){ - if [ -n "${STY}" ];then + if [ -n "${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 "LGSM creates a tmux session when starting the server." + fn_print_information_nl "LinuxGSM creates a tmux session when starting the server." echo "It is not possible to run a tmux session inside screen session" - echo "https://github.com/GameServerManagers/LinuxGSM/wiki/Tmux#tmuxception" + echo "https://docs.linuxgsm.com/requirements/tmux#tmuxception" core_exit.sh fi } diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index 8e18a619b..1fb43cea2 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/functions/command_backup.sh @@ -1,33 +1,32 @@ #!/bin/bash -# LGSM command_backup.sh function +# LinuxGSM command_backup.sh function # Author: Daniel Gibbs # Contributor: UltimateByte -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Creates a .tar.gz file in the backup directory. local commandname="BACKUP" local commandaction="Backup" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh # Trap to remove lockfile on quit. fn_backup_trap(){ echo "" - echo -ne "backup ${backupname}.tar.gz..." + echo -en "backup ${backupname}.tar.gz..." fn_print_canceled_eol_nl - fn_script_log_info "backup ${backupname}.tar.gz: CANCELED" - sleep 1 - rm -f "${backupdir}/${backupname}.tar.gz" | tee -a "${scriptlog}" - echo -ne "backup ${backupname}.tar.gz..." + 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 + fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED" + # Remove lock file. rm -f "${tmpdir}/.backup.lock" core_exit.sh } -# Check if a backup is pending or has been aborted using .backup.lock +# Check if a backup is pending or has been aborted using .backup.lock. fn_backup_check_lockfile(){ if [ -f "${tmpdir}/.backup.lock" ]; then fn_print_info_nl "Lock file found: Backup is currently running" @@ -36,18 +35,15 @@ fn_backup_check_lockfile(){ fi } -# Initialisation +# Initialisation. fn_backup_init(){ - # Backup file name with servicename and current date + # Backup file name with servicename and current date. backupname="${servicename}-$(date '+%Y-%m-%d-%H%M%S')" info_distro.sh fn_print_dots "Backup starting" fn_script_log_info "Backup starting" - sleep 1 - fn_print_ok "Backup starting" - sleep 1 - echo -ne "\n" + fn_print_ok_nl "Backup starting" if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then fn_print_info_nl "There are no previous backups" else @@ -59,71 +55,75 @@ fn_backup_init(){ daysago="${lastbackupdaysago} days ago" fi echo " * Previous backup was created ${daysago}, total size ${lastbackupsize}" - sleep 1 fi } - -# Check if server is started and wether to stop it +# Check if server is started and whether to stop it. fn_backup_stop_server(){ check_status.sh - # Server is stopped + # Server is stopped. if [ "${status}" == "0" ]; then serverstopped="no" - # Server is running and stoponbackup=off + # Server is running and stoponbackup=off. elif [ "${stoponbackup}" == "off" ]; then serverstopped="no" fn_print_warn_nl "${servicename} is currently running" echo " * Although unlikely; creating a backup while ${servicename} is running might corrupt the backup." fn_script_log_warn "${servicename} is currently running" fn_script_log_warn "Although unlikely; creating a backup while ${servicename} is running might corrupt the backup" - # Server is running and will be stopped if stoponbackup=on or unset + # Server is running and will be stopped if stoponbackup=on or unset. else fn_print_warn_nl "${servicename} will be stopped during the backup" fn_script_log_warn "${servicename} will be stopped during the backup" - sleep 4 serverstopped="yes" exitbypass=1 command_stop.sh fi } -# Create required folders +# Create required folders. fn_backup_dir(){ - # Create backupdir if it doesn't exist + # Create backupdir if it doesn't exist. if [ ! -d "${backupdir}" ]; then mkdir -p "${backupdir}" fi } fn_backup_create_lockfile(){ - # Create lockfile - date > "${tmpdir}/.backup.lock" + # Create lockfile. + date '+%s' > "${tmpdir}/.backup.lock" fn_script_log_info "Lockfile generated" fn_script_log_info "${tmpdir}/.backup.lock" # trap to remove lockfile on quit. trap fn_backup_trap INT } -# Compressing files +# Compressing files. fn_backup_compression(){ - # Tells how much will be compressed using rootdirduexbackup value from info_distro and prompt for continue + # Tells how much will be compressed using rootdirduexbackup value from info_distro and prompt for continue. fn_print_info "A total of ${rootdirduexbackup} will be compressed." fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.tar.gz" - sleep 2 fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress..." fn_script_log_info "backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress" - tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "backups" ./* + 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 "${tmpdir}/.backup.lock" ./. local exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol fn_script_log_fatal "Backup in progress: FAIL" - echo "${tarcmd}" | tee -a "${scriptlog}" + echo "${tarcmd}" | tee -a "${lgsmlog}" fn_print_fail_nl "Starting backup" fn_script_log_fatal "Starting backup" else fn_print_ok_eol - sleep 1 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 @@ -131,56 +131,100 @@ fn_backup_compression(){ rm -f "${tmpdir}/.backup.lock" } -# Clear old backups according to maxbackups and maxbackupdays variables +# Clear old backups according to maxbackups and maxbackupdays variables. fn_backup_prune(){ - # Clear if backup variables are set + # Clear if backup variables are set. if [ -n "${maxbackups}" ]&&[ -n "${maxbackupdays}" ]; then - # How many backups there are + # How many backups there are. info_distro.sh - # How many backups exceed maxbackups + # How many backups exceed maxbackups. backupquotadiff=$((backupcount-maxbackups)) - # How many backups exceed maxbackupdays + # How many backups exceed maxbackupdays. backupsoudatedcount=$(find "${backupdir}"/ -type f -name "*.tar.gz" -mtime +"${maxbackupdays}"|wc -l) - # If anything can be cleared + # If anything can be cleared. if [ "${backupquotadiff}" -gt "0" ]||[ "${backupsoudatedcount}" -gt "0" ]; then fn_print_dots "Pruning" fn_script_log_info "Backup pruning activated" - sleep 1 fn_print_ok_nl "Pruning" - sleep 1 - # If maxbackups greater or equal to backupsoutdatedcount, then it is over maxbackupdays + # If maxbackups greater or equal to backupsoutdatedcount, then it is over maxbackupdays. if [ "${backupquotadiff}" -ge "${backupsoudatedcount}" ]; then - # Display how many backups will be cleared + # Display how many backups will be cleared. echo " * Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit" fn_script_log_info "Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit" - sleep 1 + fn_sleep_time fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" - sleep 1 - # Clear backups over quota + # Clear backups over quota. find "${backupdir}"/ -type f -name "*.tar.gz" -printf '%T@ %p\n' | sort -rn | tail -${backupquotadiff} | cut -f2- -d" " | xargs rm fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)" - # If maxbackupdays is used over maxbackups + # If maxbackupdays is used over maxbackups. elif [ "${backupquotadiff}" -lt "${backupsoudatedcount}" ]; then - # Display how many backups will be cleared + # Display how many backups will be cleared. echo " * Pruning: ${backupsoudatedcount} backup(s) are older than ${maxbackupdays} days." fn_script_log_info "Pruning: ${backupsoudatedcount} backup(s) older than ${maxbackupdays} days." - sleep 1 + fn_sleep_time fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)." fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" - sleep 1 # Clear backups over quota find "${backupdir}"/ -type f -mtime +"${maxbackupdays}" -exec rm -f {} \; fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)" fi - sleep 1 fi fi } -# Restart the server if it was stopped for the backup +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 "${bdirtoks[ $(( ${#bdirtoks[@]} - 1)) ]}" + else + echo + fi +} + +# Restart the server if it was stopped for the backup. fn_backup_start_server(){ if [ "${serverstopped}" == "yes" ]; then exitbypass=1 @@ -188,7 +232,7 @@ fn_backup_start_server(){ fi } -# Run functions +# Run functions. fn_backup_check_lockfile fn_backup_create_lockfile fn_backup_init diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh index ee9f13b6e..26f0a4707 100644 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -1,48 +1,41 @@ #!/bin/bash -# LGSM command_console.sh function +# LinuxGSM command_console.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Gives access to the server tmux console. local commandname="CONSOLE" local commandaction="Console" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh fn_print_header +if [ "${shortname}" == "rust" ]||[ "${shortname}" == "hw" ]||[ "${shortname}" == "ark" ]; then + fn_print_information_nl "${gamename} does not produce a verbose output to the console" + fn_print_information_nl "${gamename} does not allow server commands to be entered in to the console" +fi fn_print_information_nl "Press \"CTRL+b\" then \"d\" to exit console." fn_print_warning_nl "Do NOT press CTRL+c to exit." +echo " * https://docs.linuxgsm.com/commands/console" 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 +if ! fn_prompt_yn "Continue?" Y; then + echo Exiting; return +fi fn_print_dots "Accessing console" -sleep 1 check_status.sh if [ "${status}" != "0" ]; then fn_print_ok_nl "Accessing console" fn_script_log_pass "Console accessed" - sleep 1 - tmux attach-session -t ${servicename} + tmux attach-session -t "${servicename}" fn_print_ok_nl "Closing console" fn_script_log_pass "Console closed" else fn_print_error_nl "Server not running" fn_script_log_error "Failed to access: Server not running" - sleep 1 - while true; do - read -e -i "y" -p "Do you want to start the server? [Y/n]" yn - case $yn in - [Yy]* ) exitbypass=1; command_start.sh; break;; - [Nn]* ) break;; - * ) echo "Please answer yes or no.";; - esac - done + if fn_prompt_yn "Do you want to start the server?" Y; then + exitbypass=1 + command_start.sh + fi fi core_exit.sh diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index ac1d0add8..2949dedab 100644 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -1,16 +1,16 @@ #!/bin/bash -# LGSM command_debug.sh function +# LinuxGSM command_debug.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Runs the server without tmux and directly from the terminal. local commandname="DEBUG" local commandaction="Debug" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Trap to remove lockfile on quit. fn_lockfile_trap(){ - # Remove lockfile + # Remove lockfile. rm -f "${rootdir}/${lockselfname}" # resets terminal. Servers can sometimes mess up the terminal on exit. reset @@ -23,36 +23,53 @@ check.sh fix.sh info_distro.sh info_config.sh -# NOTE: Check if works with server without parms. Could be intergrated in to info_parms.sh +# NOTE: Check if works with server without parms. Could be intergrated in to info_parms.sh. fn_parms fn_print_header echo -e "${blue}Distro:\t${default}${distroname}" echo -e "${blue}Arch:\t${default}${arch}" echo -e "${blue}Kernel:\t${default}${kernel}" -echo -e "${blue}Hostname:\t${default}$HOSTNAME" +echo -e "${blue}Hostname:\t${default}${HOSTNAME}" echo -e "${blue}tmux:\t${default}${tmuxv}" echo -e "${blue}Avg Load:\t${default}${load}" echo -e "${blue}Free Memory:\t${default}${physmemfree}" echo -e "${blue}Free Disk:\t${default}${availspace}" -# GLIBC required -if [ -n "${glibcrequired}" ]; then - if [ "${glibcrequired}" == "NOT REQUIRED" ]; then - : - elif [ "${glibcrequired}" == "UNKNOWN" ]; then - echo -e "${blue}GLIBC required:\t${red}${glibcrequired}" - elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then - if [ "${glibcfix}" == "yes" ]; then - echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${green}Using GLIBC fix${default})" - else - echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${red}GLIBC version too old${default})" - fi + +# glibc required. +if [ -n "${glibc}" ]; then + if [ "${glibc}" == "null" ]; then + # Glibc is not required. + : + elif [ -z "${glibc}" ]; then + echo -e "${blue}glibc required:\t${red}UNKNOWN${default}" + elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then + echo -e "${blue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})" + else + echo -e "${blue}glibc required:\t${green}${glibc}${default}" + fi +fi + +# Server IP +if [ "${multiple_ip}" == "1" ]; then + echo -e "${blue}Server IP:\t${default}NOT SET" +else + echo -e "${blue}Server IP:\t${default}${ip}:${port}" +fi +# External server IP. +if [ -n "${extip}" ]; then + if [ "${ip}" != "${extip}" ]; then + echo -e "${blue}Internet IP:\t${default}${extip}:${port}" + fi +fi +# Listed on Master Server. +if [ "${masterserver}" ];then + if [ "${masterserver}" == "true" ];then + echo -e "${blue}Master Server:\t${green}${masterserver}${default}" else - echo -e "${blue}GLIBC required:\t${green}${glibcrequired}${default}" + echo -e "${blue}Master Server:\t${red}${masterserver}${default}" fi fi -# Server ip -echo -e "${blue}Server IP:\t${default}${ip}:${port}" -# Server password +# Server password. if [ -n "${serverpassword}" ]; then echo -e "${blue}Server password:\t${default}${serverpassword}" fi @@ -68,33 +85,27 @@ echo -e "Use for identifying server issues only!" echo -e "Press CTRL+c to drop out of debug mode." fn_print_warning_nl "If ${servicename} is already running it will be stopped." echo "" -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 +if ! fn_prompt_yn "Continue?" Y; then + echo Exiting; return +fi fn_print_info_nl "Stopping any running servers" fn_script_log_info "Stopping any running servers" -sleep 1 exitbypass=1 command_stop.sh fn_print_dots "Starting debug" fn_script_log_info "Starting debug" -sleep 1 fn_print_ok_nl "Starting debug" -# Create lockfile -date > "${rootdir}/${lockselfname}" +# Create lockfile. +date '+%s' > "${rootdir}/${lockselfname}" fn_script_log_info "Lockfile generated" fn_script_log_info "${rootdir}/${lockselfname}" # trap to remove lockfile on quit. trap fn_lockfile_trap INT -cd "${executabledir}" +cd "${executabledir}" || exit +# Note: do not add double quotes to ${executable} ${parms}. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then ${executable} ${parms} -debug elif [ "${engine}" == "realvirtuality" ]; then @@ -102,10 +113,14 @@ elif [ "${engine}" == "realvirtuality" ]; then # 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 ${executable} ${parms} fi +fn_print_dots "Stopping debug" +fn_print_ok_nl "Stopping debug" # remove trap. trap - INT core_exit.sh diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 8edc61d8e..f70361d50 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -1,797 +1,33 @@ #!/bin/bash -# LGSM command_details.sh function +# LinuxGSM command_details.sh function # Author: Daniel Gibbs # Contributor: UltimateByte -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Displays server information. local commandname="DETAILS" local commandaction="Details" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" - -# Standard Details -# This applies to all engines - -fn_details_os(){ - # - # 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}" - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - { - echo -e "${blue}Distro:\t${default}${distroname}" - echo -e "${blue}Arch:\t${default}${arch}" - echo -e "${blue}Kernel:\t${default}${kernel}" - echo -e "${blue}Hostname:\t${default}$HOSTNAME" - echo -e "${blue}tmux:\t${default}${tmuxv}" - echo -e "${blue}GLIBC:\t${default}${glibcversion}" - } | column -s $'\t' -t -} - -fn_details_performance(){ - # - # Performance - # ===================================== - # Uptime: 55d, 3h, 38m - # Avg Load: 1.00, 1.01, 0.78 - # - # Mem: total used free cached - # Physical: 741M 656M 85M 256M - # Swap: 0B 0B 0B - - echo -e "" - echo -e "${lightyellow}Performance${default}" - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - { - echo -e "${blue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m" - echo -e "${blue}Avg Load:\t${default}${load}" - } | column -s $'\t' -t - echo -e "" - { - echo -e "${blue}Mem:\t${blue}total\t used\t free\t cached${default}" - echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}${default}" - echo -e "${blue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}" - } | column -s $'\t' -t -} - -fn_details_disk(){ - # - # Storage - # ===================================== - # Filesystem: /dev/disk/by-uuid/320c8edd-a2ce-4a23-8c9d-e00a7af2d6ff - # Total: 15G - # Used: 8.4G - # Available: 5.7G - # LGSM Total: 1G - # Serverfiles: 961M - # Backups: 2G - - echo -e "" - echo -e "${lightyellow}Storage${default}" - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - { - echo -e "${blue}Filesystem:\t${default}${filesystem}" - echo -e "${blue}Total:\t${default}${totalspace}" - echo -e "${blue}Used:\t${default}${usedspace}" - echo -e "${blue}Available:\t${default}${availspace}" - echo -e "${blue}LGSM Total:\t${default}${rootdirdu}" - echo -e "${blue}Serverfiles:\t${default}${filesdirdu}" - if [ -d "${backupdir}" ]; then - echo -e "${blue}Backups:\t${default}${backupdirdu}" - fi - } | column -s $'\t' -t -} - -fn_details_gameserver(){ - # - # Quake Live Server Details - # ===================================== - # Server name: ql-server - # Server IP: 1.2.3.4:27960 - # RCON password: CHANGE_ME - # Server password: NOT SET - # Maxplayers: 16 - # Status: OFFLINE - - echo -e "" - echo -e "${lightgreen}${gamename} Server Details${default}" - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - { - # Server name - if [ -n "${servername}" ]; then - echo -e "${blue}Server name:\t${default}${servername}" - fi - - # Server ip - echo -e "${blue}Server IP:\t${default}${ip}:${port}" - - # Server password - if [ -n "${serverpassword}" ]; then - echo -e "${blue}Server password:\t${default}${serverpassword}" - fi - - # RCON password - if [ -n "${rconpassword}" ]; then - echo -e "${blue}RCON password:\t${default}${rconpassword}" - fi - - # Admin password - if [ -n "${adminpassword}" ]; then - echo -e "${blue}Admin password:\t${default}${adminpassword}" - fi - - # Stats password (Quake Live) - if [ -n "${statspassword}" ]; then - echo -e "${blue}Stats password:\t${default}${statspassword}" - fi - - # Maxplayers - if [ -n "${maxplayers}" ]; then - echo -e "${blue}Maxplayers:\t${default}${maxplayers}" - fi - - # Game mode - if [ -n "${gamemode}" ]; then - echo -e "${blue}Game mode:\t${default}${gamemode}" - fi - - # Game world - if [ -n "${gameworld}" ]; then - echo -e "${blue}Game world:\t${default}${gameworld}" - fi - - # Tick rate - if [ -n "${tickrate}" ]; then - echo -e "${blue}Tick rate:\t${default}${tickrate}" - fi - - # Cluster (Don't Starve Together) - if [ -n "${cluster}" ]; then - echo -e "${blue}Cluster:\t${default}${cluster}" - fi - - # Shard (Don't Starve Together) - if [ -n "${shard}" ]; then - echo -e "${blue}Shard:\t${default}${shard}" - fi - - # TeamSpeak dbplugin - if [ -n "${dbplugin}" ]; then - echo -e "${blue}dbplugin:\t${default}${dbplugin}" - fi - - # Online status - if [ "${status}" == "0" ]; then - echo -e "${blue}Status:\t${red}OFFLINE${default}" - else - echo -e "${blue}Status:\t${green}ONLINE${default}" - fi - } | column -s $'\t' -t - echo -e "" -} - -fn_details_script(){ - # - # qlserver Script Details - # ===================================== - # Service name: ql-server - # qlserver version: 150316 - # User: lgsm - # Email alert: off - # Update on start: off - # Location: /home/lgsm/qlserver - # Config file: /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg - - echo -e "${lightgreen}${selfname} Script Details${default}" - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - { - # Service name - echo -e "${blue}Service name:\t${default}${servicename}" - - # Script version - if [ -n "${version}" ]; then - echo -e "${blue}${selfname} version:\t${default}${version}" - fi - - # User - echo -e "${blue}User:\t${default}$(whoami)" - - # GLIBC required - if [ -n "${glibcrequired}" ]; then - if [ "${glibcrequired}" == "NOT REQUIRED" ]; then - : - elif [ "${glibcrequired}" == "UNKNOWN" ]; then - echo -e "${blue}GLIBC required:\t${red}${glibcrequired}" - elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then - if [ "${glibcfix}" == "yes" ]; then - echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${green}Using GLIBC fix${default})" - else - echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${red}GLIBC version too old${default})" - fi - else - echo -e "${blue}GLIBC required:\t${green}${glibcrequired}${default}" - fi - fi - - # Email alert - echo -e "${blue}Email alert:\t${default}${emailalert}" - - # Pushbullet alert - echo -e "${blue}Pushbullet alert:\t${default}${pushbulletalert}" - - # Update on start - if [ -n "${updateonstart}" ]; then - echo -e "${blue}Update on start:\t${default}${updateonstart}" - fi - - # Script location - echo -e "${blue}Location:\t${default}${rootdir}" - - # Config file location - if [ -n "${servercfgfullpath}" ]; then - if [ -f "${servercfgfullpath}" ]; then - echo -e "${blue}Config file:\t${default}${servercfgfullpath}" - elif [ -d "${servercfgfullpath}" ]; then - echo -e "${blue}Config dir:\t${default}${servercfgfullpath}" - else - echo -e "${blue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})" - fi - fi - - # Network config file location (ARMA 3) - if [ -n "${networkcfgfullpath}" ]; then - echo -e "${blue}Network config file:\t${default}${networkcfgfullpath}" - fi - } | column -s $'\t' -t -} - -fn_details_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}" - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then - echo -e "No Backups created" - else - { - echo -e "${blue}No. of backups:\t${default}${backupcount}" - echo -e "${blue}Latest backup:${default}" - if [ "${lastbackupdaysago}" == "0" ]; then - echo -e "${blue} date:\t${default}${lastbackupdate} (less than 1 day ago)" - elif [ "${lastbackupdaysago}" == "1" ]; then - echo -e "${blue} date:\t${default}${lastbackupdate} (1 day ago)" - else - echo -e "${blue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)" - fi - echo -e "${blue} file:\t${default}${lastbackup}" - echo -e "${blue} size:\t${default}${lastbackupsize}" - } | column -s $'\t' -t - fi -} - -fn_details_commandlineparms(){ - # - # Command-line Parameters - # ===================================== - # ./run_server_x86.sh +set net_strict 1 - - echo -e "" - echo -e "${lightgreen}Command-line Parameters${default}" - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - echo -e "${executable} ${parms}" -} - -fn_details_ports(){ - # Ports - # ===================================== - # Change ports by editing the parameters in: - # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg - - echo -e "" - echo -e "${lightgreen}Ports${default}" - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - echo -e "Change ports by editing the parameters in:" - - parmslocation="${red}UNKNOWN${default}" - # engines that require editing in the config file - local ports_edit_array=( "avalanche" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "projectzomboid" "quake" "refractor" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" ) - for port_edit in "${ports_edit_array[@]}" - do - if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then - parmslocation="${servercfgfullpath}" - fi - done - # engines that require editing in the script file - local ports_edit_array=( "Hurtworld" "iw3.0" "goldsource" "Rust" "spark" "source" "starbound" "unreal4" ) - for port_edit in "${ports_edit_array[@]}" - do - if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then - parmslocation="${selfname}" - fi - done - echo -e "${parmslocation}" - echo -e "" - echo -e "Useful port diagnostic command:" -} - -fn_details_statusbottom(){ - echo -e "" - if [ "${status}" == "0" ]; then - echo -e "${blue}Status:\t${red}OFFLINE${default}" - else - echo -e "${blue}Status:\t${green}ONLINE${default}" - fi - echo -e "" -} - -# Engine Specific details - -fn_details_avalanche(){ - 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_cod(){ - echo -e "netstat -atunp | grep cod_lnxded" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_details_coduo(){ - echo -e "netstat -atunp | grep coduo_lnxded" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_details_cod2(){ - echo -e "netstat -atunp | grep cod2_lnxded" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_details_codwaw(){ - echo -e "netstat -atunp | grep codwaw_lnxded" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_details_dontstarve(){ - echo -e "netstat -atunp | grep dontstarve" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - 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_details_minecraft(){ - 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_projectzomboid(){ - 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_realvirtuality(){ - echo -e "netstat -atunp | grep arma3server" - echo -e "" - if [ -z "${port}" ]||[ -z "${queryport}" ]||[ -z "${masterport}" ]; then - echo -e "${red}ERROR!${default} 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_refractor(){ - echo -e "netstat -atunp | grep bf1942_lnxd" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_details_quake2(){ - echo -e "netstat -atunp | grep quake2" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_details_quake3(){ - echo -e "netstat -atunp | grep q3ded" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_details_quake(){ - echo -e "netstat -atunp | grep mvdsv" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_details_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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Rcon\tINBOUND\t${rconport}\tudp" - echo -e "> Stats\tINBOUND\t${statsport}\tudp" - } | column -s $'\t' -t -} - -fn_details_jk2(){ - echo -e "netstat -atunp | grep jk2ded" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_details_wolfensteinenemyterritory(){ - echo -e "netstat -atunp | grep etded" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - - -fn_details_seriousengine35(){ - 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_source(){ - 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_spark(){ - 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 "${lightgreen}${servername} WebAdmin${default}" - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - { - echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html" - echo -e "${blue}WebAdmin username:\t${default}${webadminuser}" - echo -e "${blue}WebAdmin password:\t${default}${webadminpass}" - } | column -s $'\t' -t -} - -fn_details_starbound(){ - 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_teamspeak3(){ - 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_mumble(){ - echo -e "netstat -atunp | grep murmur" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Voice\tINBOUND\t${port}\tudp" - echo -e "> ServerQuery\tINBOUND\t${port}\ttcp" - } | column -s $'\t' -t -} - -fn_details_teeworlds(){ - 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_terraria(){ - echo -e "netstat -atunp | grep TerrariaServer" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\ttcp" - } | column -s $'\t' -t -} - -fn_details_sdtd(){ - 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 "${lightgreen}${servername} WebAdmin${default}" - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - { - echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}" - echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}" - echo -e "${blue}WebAdmin password:\t${default}${webadminpass}" - } | column -s $'\t' -t - echo -e "" - echo -e "${lightgreen}${servername} Telnet${default}" - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - { - echo -e "${blue}Telnet enabled:\t${default}${telnetenabled}" - echo -e "${blue}Telnet address:\t${default}${ip} ${telnetport}" - echo -e "${blue}Telnet password:\t${default}${telnetpass}" - } | column -s $'\t' -t -} - -fn_details_hurtworld(){ - echo -e "netstat -atunp | grep Hurtworld" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_details_rust(){ - echo -e "netstat -atunp | grep Rust" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" - } | column -s $'\t' -t -} - -fn_details_unreal(){ - 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 "${lightgreen}${servername} WebAdmin${default}" - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - { - echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}" - echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}" - echo -e "${blue}WebAdmin username:\t${default}${webadminuser}" - echo -e "${blue}WebAdmin password:\t${default}${webadminpass}" - } | column -s $'\t' -t -} - -fn_details_ut3(){ - echo -e "netstat -atunp | grep ut3-bin" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp" - } | column -s $'\t' -t -} - -fn_details_ark(){ - 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 -} +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Run checks and gathers details to display. - -fn_display_details() { - check.sh - info_config.sh - info_distro.sh - info_glibc.sh - info_parms.sh - fn_details_os - fn_details_performance - fn_details_disk - fn_details_gameserver - fn_details_script - fn_details_backup - # Some game servers do not have parms. - if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then - fn_parms - fn_details_commandlineparms - fi - fn_details_ports - - # Display details depending on game or engine. - if [ "${engine}" == "avalanche" ]; then - fn_details_avalanche - elif [ "${engine}" == "refractor" ]; then - fn_details_refractor - elif [ "${engine}" == "dontstarve" ]; then - fn_details_dontstarve - elif [ "${engine}" == "lwjgl2" ]; then - fn_details_minecraft - 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}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then - fn_details_unreal - elif [ "${engine}" == "unreal3" ]; then - fn_details_ut3 - elif [ "${gamename}" == "7 Days To Die" ]; then - fn_details_sdtd - elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then - fn_details_ark - elif [ "${gamename}" == "Call of Duty" ]; then - fn_details_cod - elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then - fn_details_coduo - elif [ "${gamename}" == "Call of Duty 2" ]; then - fn_details_cod2 - elif [ "${gamename}" == "Call of Duty: World at War" ]; then - fn_details_codwaw - elif [ "${gamename}" == "Hurtworld" ]; then - fn_details_hurtworld - elif [ "${gamename}" == "QuakeWorld" ]; then - fn_details_quake - elif [ "${gamename}" == "Quake 2" ]; then - fn_details_quake2 - elif [ "${gamename}" == "Quake 3: Arena" ]; then - fn_details_quake3 - elif [ "${gamename}" == "Quake Live" ]; then - fn_details_quakelive - elif [ "${gamename}" == "Jedi Knight II: Jedi Outcast" ]; then - fn_details_jk2 - elif [ "${gamename}" == "TeamSpeak 3" ]; then - fn_details_teamspeak3 - elif [ "${gamename}" == "Mumble" ]; then - fn_details_mumble - elif [ "${gamename}" == "Rust" ]; then - fn_details_rust - elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then - fn_details_wolfensteinenemyterritory - else - fn_print_error_nl "Unable to detect server engine." - fi - - fn_details_statusbottom -} - -if [ -z "${postdetails}" ] ; -then - fn_display_details - core_exit.sh +check.sh +info_config.sh +info_parms.sh +info_distro.sh +info_messages.sh +query_gamedig.sh +fn_info_message_distro +fn_info_message_performance +fn_info_message_disk +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 100644 index 000000000..bf026ced5 --- /dev/null +++ b/lgsm/functions/command_dev_clear_functions.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# command_dev_clear_functions.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Deletes the contents of the functions dir. + +echo "=================================" +echo "Clear Functions" +echo "=================================" +echo "" +if fn_prompt_yn "Do you want to delete all functions?" Y; then + rm -rfv "${functionsdir:?}/"* + rm -rfv "${configdirdefault:?}/"* +fi +core_exit.sh \ No newline at end of file diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/functions/command_dev_debug.sh index 6186c0fb0..5229d068d 100644 --- a/lgsm/functions/command_dev_debug.sh +++ b/lgsm/functions/command_dev_debug.sh @@ -1,21 +1,20 @@ #!/bin/bash -# LGSM command_dev_debug.sh function +# LinuxGSM command_dev_debug.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Dev only: Enables debugging log to be saved to dev-debug.log. local commandname="DEV-DEBUG" local commandaction="Dev-Debug" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" - +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" 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 > "${rootdir}/.dev-debug" + date '+%s' > "${rootdir}/.dev-debug" fn_print_ok_nl "Enabled dev-debug" fn_script_log_info "Enabled dev-debug" fi -core_exit.sh \ No newline at end of file +core_exit.sh diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh index 01c96ff47..ad431a722 100644 --- a/lgsm/functions/command_dev_detect_deps.sh +++ b/lgsm/functions/command_dev_detect_deps.sh @@ -1,93 +1,137 @@ #!/bin/bash -# LGSM command_dev_detect_deps.sh function +# LinuxGSM command_dev_detect_deps.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Detects dependencies the server binary requires. -local commandname="DEPS-DETECT" -local commandaction="Deps-Detect" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandname="DETECT-DEPS" +local commandaction="Detect-Deps" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -check.sh -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 [ "$(command -v eu-readelf)" ]; then +echo "=================================" +echo "Dependencies Checker" +echo "=================================" +echo "Checking directory: " +echo "${serverfiles}" +if [ "$(command -v eu-readelf 2>/dev/null)" ]; then readelf=eu-readelf -elif [ "$(command -v readelf)" ]; then +elif [ "$(command -v readelf 2>/dev/null)" ]; then readelf=readelf else echo "readelf/eu-readelf not installed" fi - -${readelf} -d ${executable} |grep NEEDED|awk '{ print $5 }'|sed 's/\[//g'|sed 's/\]//g' > "${tmpdir}/.depdetect_readelf" - - -echo "yum install " > "${tmpdir}/.depdetect_centos_list_uniq" -echo "apt-get install " > "${tmpdir}/.depdetect_ubuntu_list_uniq" -echo "apt-get install " > "${tmpdir}/.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" >> "${tmpdir}/.depdetect_centos_list" - echo "lib32gcc1" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "lib32gcc1" >> "${tmpdir}/.depdetect_debian_list" - - elif [ "${lib}" == "libstdc++.so.6" ]; then +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" + +while read -r lib; do + echo "${lib}" + local libs_array=( libm.so.6 libc.so.6 libtcmalloc_minimal.so.4 libpthread.so.0 libdl.so.2 libnsl.so.1 libgcc_s.so.1 librt.so.1 ld-linux.so.2 libdbus-glib-1.so.2 libgio-2.0.so.0 libglib-2.0.so.0 libGL.so.1 libgobject-2.0.so.0 libnm-glib.so.4 libnm-util.so.2 ) + for lib_file in "${libs_array[@]}" + do + if [ "${lib}" == "${lib_file}" ]; then + echo "glibc.i686" >> "${tmpdir}/.depdetect_centos_list" + echo "lib32gcc1" >> "${tmpdir}/.depdetect_ubuntu_list" + echo "lib32gcc1" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + fi + done + + local 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 "java-1.8.0-openjdk" >> "${tmpdir}/.depdetect_centos_list" + echo "default-jre" >> "${tmpdir}/.depdetect_ubuntu_list" + echo "default-jre" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + fi + done + + local libs_array=( libtier0.so libtier0_srv.so libvstdlib_srv.so Core.so libvstdlib.so libtier0_s.so Editor.so Engine.so liblua.so libsteam_api.so ld-linux-x86-64.so.2 libPhysX3_x86.so libPhysX3Common_x86.so libPhysX3Cooking_x86.so) + for lib_file in "${libs_array[@]}" + do + # Known shared libs what dont requires dependencies. + if [ "${lib}" == "${lib_file}" ]; then + libdetected=1 + fi + done + + if [ "${lib}" == "libstdc++.so.6" ]; then echo "libstdc++.i686" >> "${tmpdir}/.depdetect_centos_list" echo "libstdc++6:i386" >> "${tmpdir}/.depdetect_ubuntu_list" echo "libstdc++6:i386" >> "${tmpdir}/.depdetect_debian_list" - + libdetected=1 elif [ "${lib}" == "libstdc++.so.5" ]; then echo "compat-libstdc++-33.i686" >> "${tmpdir}/.depdetect_centos_list" echo "libstdc++5:i386" >> "${tmpdir}/.depdetect_ubuntu_list" echo "libstdc++5:i386" >> "${tmpdir}/.depdetect_debian_list" - + libdetected=1 + elif [ "${lib}" == "libcurl-gnutls.so.4" ]; then + echo "libcurl.i686" >> "${tmpdir}/.depdetect_centos_list" + echo "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_ubuntu_list" + echo "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 elif [ "${lib}" == "libspeex.so.1" ]||[ "${lib}" == "libspeexdsp.so.1" ]; then echo "speex.i686" >> "${tmpdir}/.depdetect_centos_list" echo "speex:i386" >> "${tmpdir}/.depdetect_ubuntu_list" echo "speex:i386" >> "${tmpdir}/.depdetect_debian_list" - + libdetected=1 elif [ "${lib}" == "./libSDL-1.2.so.0" ]||[ "${lib}" == "libSDL-1.2.so.0" ]; then echo "SDL.i686" >> "${tmpdir}/.depdetect_centos_list" echo "libsdl1.2debian" >> "${tmpdir}/.depdetect_ubuntu_list" echo "libsdl1.2debian" >> "${tmpdir}/.depdetect_debian_list" - + libdetected=1 elif [ "${lib}" == "libtbb.so.2" ]; then echo "tbb.i686" >> "${tmpdir}/.depdetect_centos_list" echo "libtbb2" >> "${tmpdir}/.depdetect_ubuntu_list" echo "libtbb2" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + + elif [ "${lib}" == "libXrandr.so.2" ]; then + echo "libXrandr" >> "${tmpdir}/.depdetect_centos_list" + echo "libxrandr2" >> "${tmpdir}/.depdetect_ubuntu_list" + echo "libxrandr2" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libXext.so.6" ]; then + echo "libXext" >> "${tmpdir}/.depdetect_centos_list" + echo "libxext6" >> "${tmpdir}/.depdetect_ubuntu_list" + echo "libxext6" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libXtst.so.6" ]; then + echo "libXtst" >> "${tmpdir}/.depdetect_centos_list" + echo "libxtst6" >> "${tmpdir}/.depdetect_ubuntu_list" + echo "libxtst6" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libpulse.so.0" ]; then + echo "pulseaudio-libs" >> "${tmpdir}/.depdetect_centos_list" + echo "libpulse0" >> "${tmpdir}/.depdetect_ubuntu_list" + echo "libpulse0" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libopenal.so.1" ]; then + echo "" >> "${tmpdir}/.depdetect_centos_list" + echo "libopenal1" >> "${tmpdir}/.depdetect_ubuntu_list" + echo "libopenal1" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + fi - 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 + if [ "${libdetected}" != "1" ]; then unknownlib=1 echo "${lib}" >> "${tmpdir}/.depdetect_unknown" fi -done < "${tmpdir}/.depdetect_readelf" + 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" @@ -95,10 +139,10 @@ 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" - +awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_centos_list_uniq" > "${tmpdir}/.depdetect_centos_line" +awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_ubuntu_list_uniq" > "${tmpdir}/.depdetect_ubuntu_line" +awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_debian_list_uniq" > "${tmpdir}/.depdetect_debian_line" +echo "" echo "" echo "Required Dependencies" echo "=================================" @@ -127,11 +171,7 @@ fi echo "" echo "Required Librarys" echo "=================================" -sort "${tmpdir}/.depdetect_readelf" |uniq -echo "" -echo "ldd" -echo "=================================" -ldd ${executable} +sort "${tmpdir}/.depdetect_readelf" | uniq echo -en "\n" rm -f "${tmpdir}/.depdetect_centos_line" rm -f "${tmpdir}/.depdetect_centos_list" @@ -146,6 +186,8 @@ 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" \ No newline at end of file +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 index 7703fba34..7f0fc409c 100644 --- a/lgsm/functions/command_dev_detect_glibc.sh +++ b/lgsm/functions/command_dev_detect_glibc.sh @@ -1,12 +1,16 @@ #!/bin/bash -# command_dev_detect_glibc.sh function +# LinuxGSM command_dev_detect_glibc.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Automatically detects the version of GLIBC that is required. # Can check a file or directory recursively. +local commandname="DETECT-GLIBC" +local commandaction="Detect-Glibc" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + echo "=================================" -echo "GLIBC Requirements Checker" +echo "glibc Requirements Checker" echo "=================================" if [ -z "$(command -v objdump)" ]; then @@ -15,26 +19,73 @@ if [ -z "$(command -v objdump)" ]; then core_exit.sh fi -if [ -z "${filesdir}" ]; then - dir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +if [ -z "${serverfiles}" ]; then + dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" fi -if [ -d "${filesdir}" ]; then +if [ -d "${serverfiles}" ]; then echo "Checking directory: " - echo "${filesdir}" -elif [ -f "${filesdir}" ]; then + echo "${serverfiles}" +elif [ -f "${serverfiles}" ]; then echo "Checking file: " - echo "${filesdir}" + echo "${serverfiles}" fi echo "" -files=$(find ${filesdir} | wc -l) -find ${filesdir} -type f -print0 | -while IFS= read -r -d $'\0' line; do - objdump -T $line 2>/dev/null|grep -oP "GLIBC[^ ]+" >>"${tmpdir}/detect_glibc.tmp" - echo -n "$i / $files" $'\r' - ((i++)) + +local 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 "${glibcversion}: ${line}" >>"${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" + fi + objdump -T "${line}" 2>/dev/null | grep -oP "GLIBC[^ ]+" >>"${tmpdir}/detect_glibc_${glibc_check_var}.tmp" + echo -n "${i} / ${glibc_check_files}" $'\r' + ((i++)) + done + echo "" + echo "" + echo "${glibc_check_name} glibc Requirements" + echo "=================================" + if [ -f "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" ]; then + echo "Required glibc" + cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort | head -1 |tee -a "${tmpdir}/detect_glibc_highest.tmp" + echo "" + echo "Files requiring GLIBC" + echo "Highest verion required: filename" + cat "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" + echo "" + echo "All required GLIBC versions" + cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort + rm "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" + rm "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" + else + fn_print_information_nl "glibc is not required" + fi + else + fn_print_information_nl "${glibc_check_name} is not installed" + fi done echo "" -cat "${tmpdir}/detect_glibc.tmp"|sort|uniq|sort -r --version-sort -rm "${tmpdir}/detect_glibc.tmp" \ No newline at end of file +echo "Final glibc Requirement" +echo "=================================" +if [ -f "${tmpdir}/detect_glibc_highest.tmp" ]; then + cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1 + rm "${tmpdir}/detect_glibc_highest.tmp" +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 index 07ad3f581..95898c4e4 100644 --- a/lgsm/functions/command_dev_detect_ldd.sh +++ b/lgsm/functions/command_dev_detect_ldd.sh @@ -1,38 +1,42 @@ #!/bin/bash # command_dev_detect_ldd.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Automatically detects required deps using ldd. # Can check a file or directory recursively. +local commandname="DETECT-LDD" +local commandaction="Detect-LDD" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + echo "=================================" echo "Shared Object dependencies Checker" echo "=================================" -if [ -z "${filesdir}" ]; then - dir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +if [ -z "${serverfiles}" ]; then + dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" fi -if [ -d "${filesdir}" ]; then +if [ -d "${serverfiles}" ]; then echo "Checking directory: " - echo "${filesdir}" -elif [ -f "${filesdir}" ]; then + echo "${serverfiles}" +elif [ -f "${serverfiles}" ]; then echo "Checking file: " - echo "${filesdir}" + echo "${serverfiles}" fi echo "" -files=$(find ${filesdir} | wc -l) -find ${filesdir} -type f -print0 | +files=$(find "${serverfiles}" | wc -l) +find "${serverfiles}" -type f -print0 | while IFS= read -r -d $'\0' line; do - #ldd -v $line 2>/dev/null|grep "=>" >>"${tmpdir}/detect_ldd.tmp" - if [ -n "$(ldd $line 2>/dev/null |grep -v "not a dynamic executable")" ]; then - echo "$line" >> "${tmpdir}/detect_ldd.tmp" - ldd $line 2>/dev/null |grep -v "not a dynamic executable" >> "${tmpdir}/detect_ldd.tmp" - - if [ -n "$(ldd $line 2>/dev/null |grep -v "not a dynamic executable"|grep "not found")" ]; then - echo "$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" + if ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" + then + echo "${line}" >> "${tmpdir}/detect_ldd.tmp" + ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" >> "${tmpdir}/detect_ldd.tmp" + if ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" | grep "not found" + then + echo "${line}" >> "${tmpdir}/detect_ldd_not_found.tmp" + 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' @@ -50,4 +54,6 @@ echo "=================================" cat "${tmpdir}/detect_ldd_not_found.tmp" rm "${tmpdir}/detect_ldd.tmp" -rm "${tmpdir}/detect_ldd_not_found.tmp" \ No newline at end of file +rm "${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 100644 index 000000000..79072468f --- /dev/null +++ b/lgsm/functions/command_dev_query_raw.sh @@ -0,0 +1,100 @@ +#!/bin/bash +# command_dev_query_raw.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Raw gamedig output of the server. + +local commandname="QUERY-RAW" +local commandaction="Query Raw" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +echo "" +echo "Query Port" +echo "==================================================================" +echo "" +echo "Gamedig Raw Output" +echo "=================================" +echo"" +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 + +check.sh +info_config.sh +info_parms.sh +if [ "${engine}" == "idtech3_ql" ]; then + local engine="quakelive" +elif [ "${shortname}" == "kf2" ]; then + local engine="unreal4" +fi + +query_gamedig.sh +echo "${gamedigcmd}" +echo"" +echo "${gamedigraw}" | jq +echo"" +echo "gsquery Raw Output" +echo "=================================" +echo"" +echo "./query_gsquery.py -a \"${ip}\" -p \"${queryport}\" -e \"${engine}\"" +if [ ! -f "${functionsdir}/query_gsquery.py" ]; then + fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nomd5" +fi +"${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${engine}" + +echo"" +echo "TCP Raw Output" +echo "=================================" +echo"" +echo "bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''" +bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}'' +querystatus="$?" +if [ "${querystatus}" == "0" ]; then + echo "TCP query PASS" +else + echo "TCP query FAIL" +fi + +echo"" +echo "UDP Raw Output" +echo "=================================" +echo"" +echo "bash -c 'exec 3<> /dev/udp/'${ip}'/'${queryport}''" +bash -c 'exec 3<> /dev/udp/'${ip}'/'${queryport}'' +querystatus="$?" +if [ "${querystatus}" == "0" ]; then + echo "UPD query PASS" +else + echo "UPD query FAIL" +fi +echo "" +echo "Game Port" +echo "==================================================================" +echo "" +echo"" +echo "TCP Raw Output" +echo "=================================" +echo"" +echo "bash -c 'exec 3<> /dev/tcp/'${ip}'/'${port}''" +bash -c 'exec 3<> /dev/tcp/'${ip}'/'${port}'' +querystatus="$?" +if [ "${querystatus}" == "0" ]; then + echo "TCP query PASS" +else + echo "TCP query FAIL" +fi + +echo"" +echo "UDP Raw Output" +echo "=================================" +echo"" +echo "bash -c 'exec 3<> /dev/udp/'${ip}'/'${port}''" +bash -c 'exec 3<> /dev/udp/'${ip}'/'${port}'' +querystatus="$?" +if [ "${querystatus}" == "0" ]; then + echo "UDP query PASS" +else + echo "UDP query FAIL" +fi diff --git a/lgsm/functions/command_donate.sh b/lgsm/functions/command_donate.sh new file mode 100644 index 000000000..a277b87b6 --- /dev/null +++ b/lgsm/functions/command_donate.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# LinuxGSM command_donate.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Shows ways to donate + +echo -e "" +echo -e "${lightyellow}Support LinuxGSM${default}" +echo -e "=================================" +echo -e "" +echo -e "Been using LinuxGSM?" +echo -e "Consider donating to support development." +echo -e "" +echo -e "* ${blue}Patreon:${default} https://linuxgsm.com/patreon" +echo -e "* ${blue}PayPal:${default} https://linuxgsm.com/paypal" +echo -e "* ${blue}Flattr:${default} https://linuxgsm.com/flattr" +echo -e "" +echo -e "LinuxGSM has been going since 2012" \ No newline at end of file diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index c66834b98..bf75b8177 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -1,335 +1,433 @@ #!/bin/bash -# LGSM command_fastdl.sh function +# LinuxGSM command_fastdl.sh function # Author: Daniel Gibbs # Contributor: UltimateByte -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Creates a FastDL directory. local commandname="FASTDL" local commandaction="FastDL" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh -# Directories -webdir="${rootdir}/public_html" +# Directories. +if [ -z "${webdir}" ]; then + webdir="${rootdir}/public_html" +fi fastdldir="${webdir}/fastdl" addonsdir="${systemdir}/addons" -# Server lua autorun dir, used to autorun lua on client connect to the server +# Server lua autorun dir, used to autorun lua on client connect to the server. luasvautorundir="${systemdir}/lua/autorun/server" luafastdlfile="lgsm_cl_force_fastdl.lua" luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" -fn_check_bzip2(){ - # Returns true if not installed - if [ -z "$(command -v bzip2)" ]; then - bzip2installed="0" - fn_print_info "bzip2 is not installed !" - fn_script_log_info "bzip2 is not installed" - echo -en "\n" - sleep 1 - echo "We advise using it" - echo "For more information, see https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL#bzip2-compression" - sleep 2 +# Check if bzip2 is installed. +if [ -z "$(command -v bzip2 2>/dev/null)" ]; then + fn_print_fail "bzip2 is not installed" + fn_script_log_fatal "bzip2 is not installed" + core_exit.sh +fi + +# Header +fn_print_header +echo "More info: https://docs.linuxgsm.com/commands/fastdl" +echo "" + +# Prompts user for FastDL creation settings. +echo "${commandaction} setup" +echo "=================================" + +# Prompt for clearing old files if directory was already here. +if [ -d "${fastdldir}" ]; then + fn_print_warning_nl "FastDL directory already exists." + echo "${fastdldir}" + echo "" + if fn_prompt_yn "Overwrite existing directory?" Y; then + fn_script_log_info "Overwrite existing directory: YES" else - bzip2installed="1" + core_exit.sh fi -} +fi -fn_fastdl_init(){ - # User confirmation - fn_print_ok "Welcome to LGSM's FastDL generator" - sleep 1 - echo -en "\n" - fn_script_log "Started FastDL creation" - while true; do - read -e -i "y" -p "Continue? [Y/n]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) exit;; - * ) echo "Please answer yes or no.";; - esac - done - fn_script_log "Initiating FastDL creation" +# 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 - # Check and create directories +# Clears any fastdl directory content. +fn_clear_old_fastdl(){ + # Clearing old FastDL. + if [ -d "${fastdldir}" ]; then + echo -en "clearing existing FastDL directory ${fastdldir}..." + rm -R "${fastdldir:?}" + exitcode=$? + if [ ${exitcode} -ne 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 + fn_sleep_time + fi +} + +fn_fastdl_dirs(){ + # Check and create directories. if [ ! -d "${webdir}" ]; then - echo "" - fn_print_info "Creating FastDL directories" - echo -en "\n" - sleep 1 - fn_print_dots "Creating ${webdir} directory" - sleep 0.5 - mkdir "${webdir}" - fn_print_ok "Created ${webdir} directory" - fn_script_log "FastDL created ${webdir} directory" - sleep 1 - echo -en "\n" + echo -en "creating web directory ${webdir}..." + mkdir -p "${webdir}" + exitcode=$? + if [ ${exitcode} -ne 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 + fn_sleep_time fi if [ ! -d "${fastdldir}" ]; then - # No directory, won't ask for removing old ones - newfastdl=1 - fn_print_dots "Creating fastdl directory" - sleep 0.5 - mkdir "${fastdldir}" - fn_print_ok "Created fastdl directory" - fn_script_log "FastDL created fastdl directory" - sleep 1 - echo -en "\n" - clearoldfastdl="off" # Nothing to clear - elif [ "$(ls -A "${fastdldir}")" ]; then - newfastdl=0 + echo -en "creating fastdl directory ${fastdldir}..." + mkdir -p "${fastdldir}" + exitcode=$? + if [ ${exitcode} -ne 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 + fn_sleep_time fi } -fn_fastdl_config(){ - # Global settings for FastDL creation - fn_print_info "Entering configuration" - fn_script_log "Configuration" - sleep 2 - echo -en "\n" - # Prompt for clearing old files if directory was already here - if [ -n "${newfastdl}" ] && [ "${newfastdl}" == "0" ]; then - fn_print_dots - while true; do - read -e -i "y" -p "Clear old FastDL files? [Y/n]" yn - case $yn in - [Yy]* ) clearoldfastdl="on"; fn_script_log "clearoldfastdl enabled"; fn_print_ok "Clearing Enabled"; break;; - [Nn]* ) clearoldfastdl="off"; fn_script_log "clearoldfastdl disabled"; fn_print_ok "Clearing Disabled"; break;; - * ) echo "Please answer yes or no.";; - esac - done - echo -en "\n" - fi - # Prompt for using bzip2 if it's installed - if [ ${bzip2installed} == 1 ]; then - fn_print_dots - while true; do - read -e -i "y" -p "Enable file compression using bzip2? [Y/n]" yn - case $yn in - [Yy]* ) bzip2enable="on"; fn_script_log "bzip2 enabled"; fn_print_ok "bzip2 Enabled"; break;; - [Nn]* ) bzip2enable="off"; fn_script_log "bzip2 disabled"; fn_print_ok "bzip2 Disabled"; break;; - * ) echo "Please answer yes or no.";; - esac +# 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 "1 byte" + else + for item in "${abbrevs[@]}"; do + local factor="${item%:*}" + local abbrev="${item#*:}" + if [[ "${bytes}" -ge "${factor}" ]]; then + local size="$(bc -l <<< "${bytes} / ${factor}")" + printf "%.*f %s\n" "${precision}" "${size}" "${abbrev}" + break + fi done - echo -en "\n" fi } -fn_fastdl_gmod_config(){ - # Prompt for download enforcer, that is using a .lua addfile resource generator - fn_print_dots - while true; do - read -e -i "y" -p "Use client download enforcer? [Y/n]" yn - case $yn in - [Yy]* ) luaressource="on"; fn_script_log "DL enforcer Enabled"; fn_print_ok "Enforcer Enabled"; break;; - [Nn]* ) luaressource="off"; fn_script_log "DL enforcer Disabled"; fn_print_ok "Enforcer Disabled"; break;; - * ) echo "Please answer yes or no.";; - esac - done - echo -en "\n" -} - -fn_clear_old_fastdl(){ - # Clearing old FastDL if user answered yes - if [ "${clearoldfastdl}" == "on" ]; then - fn_print_info "Clearing existing FastDL directory" - fn_script_log "Clearing existing FastDL directory" - sleep 0.5 - rm -R "${fastdldir:?}"/* - fn_print_ok "Old FastDL directory cleared" - fn_script_log "Old FastDL directory cleared" - sleep 1 - echo -en "\n" +# 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 + printf "gathering ${allowed_extention} : ${fileswc}..." + echo "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" + done < <(find . -type f -iname ${allowed_extention}) + if [ ${fileswc} != 0 ]; then + fn_print_ok_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 + printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." + echo "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" + done < <(find "${systemdir}/${directory}" -type f -iname ${allowed_extention}) + tput rc; tput el + printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." + if [ ${fileswc} != 0 ]; then + fn_print_ok_eol_nl + fi + done + fi + done + fi + if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + echo "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 "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + rm "${tmpdir}/fastdl_files_to_compress.txt" + if ! fn_prompt_yn "Continue?" Y; then + fn_script_log "User exited" + core_exit.sh fi } -fn_gmod_fastdl(){ - # Copy all needed files for FastDL - echo "" - fn_print_dots "Starting gathering all needed files" - fn_script_log "Starting gathering all needed files" - sleep 1 - echo -en "\n" - - # No choice to cd to the directory, as find can't then display relative directory - cd "${systemdir}" - - # Map Files - fn_print_dots "Copying map files..." - fn_script_log "Copying map files" - sleep 0.5 - find . -name '*.bsp' | cpio --quiet -updm "${fastdldir}" - find . -name '*.ain' | cpio --quiet -updm "${fastdldir}" - fn_print_ok "Map files copied" - sleep 0.5 - echo -en "\n" - - # Materials - fn_print_dots "Copying materials..." - fn_script_log "Copying materials" - sleep 0.5 - find . -name '*.vtf' | cpio --quiet -updm "${fastdldir}" - find . -name '*.vmt' | cpio --quiet -updm "${fastdldir}" - fn_print_ok "Materials copied" - sleep 0.5 - echo -en "\n" - - # Models - fn_print_dots "Copying models..." - fn_script_log "Copying models" - sleep 1 - find . -name '*.vtx' | cpio --quiet -updm "${fastdldir}" - find . -name '*.vvd' | cpio --quiet -updm "${fastdldir}" - find . -name '*.mdl' | cpio --quiet -updm "${fastdldir}" - find . -name '*.phy' | cpio --quiet -updm "${fastdldir}" - fn_print_ok "Models copied" - sleep 0.5 - echo -en "\n" - - # Particles - fn_print_dots "Copying particles..." - fn_script_log "Copying particles" - sleep 0.5 - find . -name '*.pcf' | cpio --quiet -updm "${fastdldir}" - fn_print_ok "Particles copied" - sleep 0.5 - echo -en "\n" - - # Sounds - fn_print_dots "Copying sounds..." - fn_script_log "Copying sounds" - sleep 0.5 - find . -name '*.wav' | cpio --quiet -updm "${fastdldir}" - find . -name '*.mp3' | cpio --quiet -updm "${fastdldir}" - find . -name '*.ogg' | cpio --quiet -updm "${fastdldir}" - fn_print_ok "Sounds copied" - sleep 0.5 - echo -en "\n" - - # Resources (mostly fonts) - fn_print_dots "Copying fonts and png..." - fn_script_log "Copying fonts and png" - sleep 1 - find . -name '*.otf' | cpio --quiet -updm "${fastdldir}" - find . -name '*.ttf' | cpio --quiet -updm "${fastdldir}" - find . -name '*.png' | cpio --quiet -updm "${fastdldir}" - fn_print_ok "Fonts and png copied" - sleep 0.5 - echo -en "\n" - - # Going back to rootdir in order to prevent mistakes - cd "${rootdir}" - - # Correct addons directory structure for FastDL +# 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 + printf "copying ${allowed_extention} : ${fileswc}..." + cp --parents "${fastdlfile}" "${fastdldir}" + exitcode=$? + if [ ${exitcode} -ne 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 - fn_print_info "Adjusting addons' file structure" - fn_script_log "Adjusting addon's file structure" - sleep 1 + echo -en "updating addons file structure..." cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}" - #Don't remove yet rm -R "${fastdldir:?}/addons" - fn_print_ok "Adjusted addon's file structure" - sleep 1 - echo -en "\n" + exitcode=$? + if [ ${exitcode} -ne 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 -R "${fastdldir:?}/addons" + exitcode=$? + if [ ${exitcode} -ne 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 + # Correct content that may be into a lua directory by mistake like some darkrpmodification addons. if [ -d "${fastdldir}/lua" ]; then - fn_print_dots "Typical DarkRP shit detected, fixing" - sleep 2 + echo -en "correcting DarkRP files..." + fn_sleep_time cp -Rf "${fastdldir}/lua/"* "${fastdldir}" - fn_print_ok "Stupid DarkRP file structure fixed" - sleep 2 - echo -en "\n" + exitcode=$? + if [ ${exitcode} -ne 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 dufile; do + filesize=$(du -b "${dufile}" | awk '{ print $1 }') + filesizetotal=$(( ${filesizetotal} + ${filesize} )) + done <"${tmpdir}/fastdl_files_to_compress.txt" fi } -# Generate lua file that will force download any file into the FastDL directory -fn_lua_fastdl(){ - # Remove lua file if luaressource is turned off and file exists - echo "" - if [ "${luaressource}" == "off" ]; then - if [ -f "${luafastdlfullpath}" ]; then - fn_print_dots "Removing download enforcer" - sleep 1 - rm -R "${luafastdlfullpath:?}" - fn_print_ok "Removed download enforcer" - fn_script_log "Removed old download inforcer" - echo -en "\n" - sleep 2 +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 + printf "copying ${directory} ${allowed_extention} : ${fileswc}..." + fn_sleep_time + if [ ! -d "${fastdldir}/${directory}" ]; then + mkdir "${fastdldir}/${directory}" + fi + cp "${fastdlfile}" "${fastdldir}/${directory}" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}/${directory}" + core_exit.sh + else + fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}/${directory}" + fi + done < <(find "${systemdir}/${directory}" -type f -iname ${allowed_extention}) + if [ ${fileswc} != 0 ]; then + fn_print_ok_eol_nl + fi + done fi - fi - # Remove old lua file and generate a new one if user said yes - if [ "${luaressource}" == "on" ]; then - if [ -f "${luafastdlfullpath}" ]; then - fn_print_dots "Removing old download enforcer" - sleep 1 - rm "${luafastdlfullpath}" - fn_print_ok "Removed old download enforcer" - fn_script_log "Removed old download enforcer" - echo -en "\n" - sleep 1 - fi - fn_print_dots "Generating new download enforcer" - fn_script_log "Generating new download enforcer" - sleep 1 - # Read all filenames and put them into a lua file at the right path - find "${fastdldir}" \( -type f ! -name "*.bz2" \) -printf '%P\n' | while read line; do - echo "resource.AddFile( "\""${line}"\"" )" >> ${luafastdlfullpath} - done - fn_print_ok "Download enforcer generated" - fn_script_log "Download enforcer generated" - echo -en "\n" - echo "" - sleep 2 - fi + done } -fn_fastdl_bzip2(){ - # Compressing using bzip2 if user said yes - echo "" - if [ ${bzip2enable} == "on" ]; then - fn_print_info "Have a break, this step could take a while..." - echo -en "\n" - echo "" - fn_print_dots "Compressing files using bzip2..." - fn_script_log "Compressing files using bzip2..." - # bzip2 all files that are not already compressed (keeping original files) - find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec bzip2 -qk \{\} \; - fn_print_ok "bzip2 compression done" - fn_script_log "bzip2 compression done" - sleep 1 - echo -en "\n" +# 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 } -fn_fastdl_completed(){ - # Finished message - echo "" - fn_print_ok "Congratulations, it's done!" - fn_script_log "FastDL job done" - sleep 2 - echo -en "\n" - echo "" - fn_print_info "Need more documentation? See https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL" - echo -en "\n" - if [ "$bzip2installed" == "0" ]; then - echo "By the way, you'd better install bzip2 and re-run this command!" +# 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 "${luafastdlfullpath:?}" + exitcode=$? + if [ ${exitcode} -ne 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 "resource.AddFile( \"${line}\" )" >> "${luafastdlfullpath}" + done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n') + exitcode=$? + if [ ${exitcode} -ne 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 - echo "Credits : UltimateByte" } -# Game checking and functions running -# Garry's Mod -if [ "${gamename}" == "Garry's Mod" ]; then - fn_check_bzip2 - fn_fastdl_init - fn_fastdl_config - fn_fastdl_gmod_config - fn_clear_old_fastdl - fn_gmod_fastdl - fn_lua_fastdl - fn_fastdl_bzip2 - fn_fastdl_completed - exit -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} -ne 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 "FastDL files are located in:" +echo "${fastdldir}" +echo "FastDL completed" +fn_script_log_info "FastDL completed" +core_exit.sh diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index d7c3cbc54..c1192a60a 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -1,41 +1,50 @@ #!/bin/bash -# LGSM command_install.sh function +# LinuxGSM command_install.sh function # Author: Daniel Gibbs # Contributor: UltimateByte -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Overall function for the installer. local commandname="INSTALL" local commandaction="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh -install_header.sh -install_server_dir.sh -install_logs.sh -check_deps.sh -# Download and install -if [ "${gamename}" == "Unreal Tournament 2004" ]; then - install_server_files.sh - install_ut2k4_key.sh -elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]||[ "${gamename}" == "Call of Duty 2" ]||[ "${gamename}" == "Call of Duty: World at War" ]||[ "${gamename}" == "Minecraft" ]||[ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]||[ "${gamename}" == "QuakeWorld" ]||[ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament" ]||[ "${gamename}" == "Unreal Tournament 3" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Mumble" ]||[ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then - installer=1 - install_server_files.sh -elif [ -n "${appid}" ]; then - install_steamcmd.sh - install_server_files.sh -fi +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 + installer=1 + install_server_files.sh + elif [ -n "${appid}" ]; then + install_steamcmd.sh + install_server_files.sh + fi -# Configuration -install_config.sh -if [ "${gamename}" == "Counter-Strike: Global Offensive" ]||[ "${gamename}" == "Team Fortress 2" ]||[ "${gamename}" == "BrainBread 2" ]; then - install_gslt.sh -elif [ "${gamename}" == "Don't Starve Together" ]; then - install_dst_token.sh -elif [ "${gamename}" == "TeamSpeak 3" ]; then - install_ts3db.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 + fi -fix.sh -install_complete.sh -core_exit.sh + fix.sh + install_complete.sh + core_exit.sh +fi diff --git a/lgsm/functions/command_install_resources_mta.sh b/lgsm/functions/command_install_resources_mta.sh new file mode 100644 index 000000000..7e7c4bb10 --- /dev/null +++ b/lgsm/functions/command_install_resources_mta.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# LinuxGSM command_install_resources_mta.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Installs the default resources for Multi Theft Auto. + +local commandname="DEFAULT_RESOURCES" +local commandaction="Default Resources" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_install_resources(){ + echo "" + echo "Installing Default Resources" + echo "=================================" + fn_fetch_file "http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip" "${tmpdir}" "mtasa-resources-latest.zip" "nochmodx" "norun" "noforce" "nomd5" + fn_dl_extract "${tmpdir}" "mtasa-resources-latest.zip" "${resourcesdir}" + echo "Default Resources Installed." +} + +fn_print_header + +fn_print_warning_nl "Installing the default resources with existing resources may cause issues." +if fn_prompt_yn "Do you want to install MTA default resources?" Y; then + fn_install_resources +fi diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/functions/command_mods_install.sh new file mode 100644 index 000000000..cac08929d --- /dev/null +++ b/lgsm/functions/command_mods_install.sh @@ -0,0 +1,111 @@ +#!/bin/bash +# LinuxGSM command_mods_install.sh function +# Author: Daniel Gibbs +# Contributor: UltimateByte +# Website: https://linuxgsm.com +# Description: List and installs available mods along with mods_list.sh and mods_core.sh. + +local commandname="MODS" +local commandaction="addons/mods" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +check.sh +mods_core.sh + +fn_print_header + +# Displays a list of installed mods. +fn_mods_installed_list +if [ "${installedmodscount}" -gt "0" ]; then + echo "Installed addons/mods" + echo "=================================" + # Go through all available commands, get details and display them to the user. + 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 "" +fi + +echo "Available addons/mods" +echo "=================================" +# 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 "" +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 "" +echo "Installing ${modprettyname}" +echo "=================================" +fn_script_log_info "${modprettyname} selected for install" + +# Check if the mod is already installed and warn the user. +if [ -f "${modsinstalledlistfullpath}" ]; then + if [ -n "$(sed -n "/^${modcommand}$/p" "${modsinstalledlistfullpath}")" ]; then + fn_print_warning_nl "${modprettyname} is already installed" + fn_script_log_warn "${modprettyname} is already installed" + echo " * Any configs may be overwritten." + if ! fn_prompt_yn "Continue?" Y; then + echo Exiting; core_exit.sh + fi + fn_script_log_info "User selected to continue" + fi +fi + +## Installation. + +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 +echo "${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 100644 index 000000000..9c64d4808 --- /dev/null +++ b/lgsm/functions/command_mods_remove.sh @@ -0,0 +1,132 @@ +#!/bin/bash +# LinuxGSM command_mods_uninstall.sh function +# Author: Daniel Gibbs +# Contributor: UltimateByte +# Website: https://linuxgsm.com +# Description: Uninstall mods along with mods_list.sh and mods_core.sh. + +local commandname="MODS" +local commandaction="Mods Remove" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +check.sh +mods_core.sh +fn_mods_check_installed + +fn_print_header +echo "Remove addons/mods" +echo "=================================" + +# 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 "" +# 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 " * Any custom files/configuration will be removed." +if ! fn_prompt_yn "Continue?" Y; then + echo Exiting; exit +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} -ne 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 "removing ${modprettyname} ${modfileline} / ${modsfilelistsize} : ${currentfileremove}..." + ((modfileline++)) +done +if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh +else + fn_print_ok_eol_nl +fi +fn_sleep_time +# Remove file list. +echo -en "removing ${modcommand}-files.txt..." +fn_sleep_time +rm -rf "${modsdir}/${modcommand}-files.txt" +local exitcode=$? +if [ ${exitcode} -ne 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}" +local exitcode=$? +if [ ${exitcode} -ne 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 + unset exitbypass +fi +echo "${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 100644 index 000000000..70a91cf5e --- /dev/null +++ b/lgsm/functions/command_mods_update.sh @@ -0,0 +1,108 @@ +#!/bin/bash +# LinuxGSM command_mods_update.sh function +# Author: Daniel Gibbs +# Contributor: UltimateByte +# Website: https://linuxgsm.com +# Description: Updates installed mods along with mods_list.sh and mods_core.sh. + +local commandname="MODS" +local commandaction="Mods Update" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +check.sh +mods_core.sh + +# Prevents specific files being overwritten upon update (set by ${modkeepfiles}). +# For that matter, remove cfg files after extraction before copying them to destination. +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 "${modkeepfiles}" | awk -F ';' '{ print NF }')" + # Test all subvalues of "modkeepfiles" using the ";" separator. + for ((preservefilesindex=1; preservefilesindex < ${filestopreserve}; preservefilesindex++)); do + # Put the current file we are looking for into a variable. + filetopreserve="$(echo "${modkeepfiles}" | awk -F ';' -v x=${preservefilesindex} '{ print $x }' )" + 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 "${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 [ -n "${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 "" + echo "==> 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 "" +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 index 7f247795f..772be28a9 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -1,17 +1,92 @@ #!/bin/bash -# LGSM command_monitor.sh function +# LinuxGSM command_monitor.sh function # Author: Daniel Gibbs # Contributor: UltimateByte -# Website: https://gameservermanagers.com -# Description: Monitors server by checking for running processes. -# then passes to monitor_gsquery.sh. +# Website: https://linuxgsm.com +# Description: Monitors server by checking for running processes +# then passes to gamedig and gsquery. local commandname="MONITOR" local commandaction="Monitor" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_monitor_loop(){ +# Monitor will query up to 5 times every 15 seconds. +# Query will wait up to 60 seconds to confirm server is down giving server time if changing map. +totalseconds=0 +for queryattempt in {1..5}; do + fn_print_dots "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_querying_eol + fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : QUERYING" + if [ "$(cat "${rootdir}/${lockselfname}")" > "$(date "+%s" -d "${querydelay} mins ago")" ]; then + fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_delay_eol + fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : DELAY" + fn_script_log_info "Query bypassed: ${gameservername} started less than ${querydelay} minute ago" + monitorpass=1 + core_exit.sh + elif [ "${querymethod}" == "gamedig" ]; then + query_gamedig.sh + elif [ "${querymethod}" == "gsquery" ]; then + if [ ! -f "${functionsdir}/query_gsquery.py" ]; then + fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nomd5" + fi + "${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${engine}" > /dev/null 2>&1 + querystatus="$?" + elif [ "${querymethod}" == "tcp" ]; then + bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}'' + querystatus="$?" + elif [ "${querymethod}" == "udp" ]; then + bash -c 'exec 3<> /dev/udp/'${ip}'/'${queryport}'' + querystatus="$?" + fi + + if [ "${querystatus}" == "0" ]; then + # Server query OK. + fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_ok_eol_nl + fn_script_log_pass "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: OK" + monitorpass=1 + core_exit.sh + else + # Server query FAIL. + fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: FAIL" + fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_fail_eol + # Monitor try gamedig first then gsquery before restarting. + if [ "${querymethod}" == "gsquery" ]; then + if [ "${totalseconds}" -ge "59" ]; then + # Server query FAIL for over 59 seconds reboot server. + fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_fail_eol_nl + fn_script_log_error "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: FAIL" + + # Send alert if enabled. + alert="restartquery" + alert.sh + command_restart.sh + core_exit.sh + fi + elif [ "${querymethod}" == "gamedig" ]; then + if [ "${totalseconds}" -ge "29" ]; then + break + fi + fi + + # Seconds counter. + for seconds in {1..15}; do + fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: WAIT" + totalseconds=$((totalseconds + 1)) + if [ "${seconds}" == "15" ]; then + break + fi + done + fi +done +} fn_monitor_check_lockfile(){ - # Monitor does not run it lockfile is not found + # Monitor does not run it lockfile is not found. if [ ! -f "${rootdir}/${lockselfname}" ]; then fn_print_error_nl "Disabled: No lockfile found" fn_script_log_error "Disabled: No lockfile found" @@ -22,97 +97,120 @@ fn_monitor_check_lockfile(){ fn_monitor_check_update(){ # Monitor will not check if update is running. - if [ "$(ps -ef|grep "${selfname} update"|grep -v grep|wc -l)" != "0" ]; then + if [ "$(ps -ef | grep "${selfname} update" | grep -v grep | wc -l)" != "0" ]; then fn_print_error_nl "SteamCMD is currently checking for updates" fn_script_log_error "SteamCMD is currently checking for updates" - sleep 1 core_exit.sh fi } -fn_monitor_msg_checking(){ +fn_monitor_check_session(){ fn_print_dots "Checking session: " fn_print_checking_eol fn_script_log_info "Checking session: CHECKING" - sleep 1 -} - -fn_monitor_teamspeak3(){ 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: ${ts3error}: " + if [ "${shortname}" == "ts3" ]; then + fn_print_error "Checking session: ${ts3error}: " + elif [ "${shortname}" == "mumble" ]; then + fn_print_error "Checking session: Not listening to port ${queryport}" + else + fn_print_error "Checking session: " + fi fn_print_fail_eol_nl - fn_script_log_error "Checking session: ${ts3error}: FAIL" - failurereason="${ts3error}" + fn_script_log_error "Checking session: FAIL" alert="restart" alert.sh fn_script_log_info "Monitor is starting ${servername}" - sleep 1 command_restart.sh + core_exit.sh fi } -fn_monitor_mumble(){ - 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: Not listening to port ${port}" - fn_print_fail_eol_nl - fn_script_log_error "Checking session: Not listening to port ${port}" - failurereason="Checking session: Not listening to port ${port}" - alert="restart" - alert.sh - fn_script_log_info "Monitor is starting ${servername}" - sleep 1 - command_restart.sh - fi -} -fn_monitor_tmux(){ - # checks that tmux session is running - if [ "${status}" != "0" ]; then - fn_print_ok "Checking session: " - fn_print_ok_eol_nl - fn_script_log_pass "Checking session: OK" - # runs gsquery check on game with specific engines. - local allowed_engines_array=( avalanche goldsource idtech3 idtech3_ql iw2.0 iw3.0 quake refractor realvirtuality source spark unity3d unreal unreal2 ) - for allowed_engine in "${allowed_engines_array[@]}" - do - if [ "${allowed_engine}" == "${engine}" ]; then - monitor_gsquery.sh +fn_monitor_query(){ + fn_script_log_info "Querying port: query enabled" + # Engines that work with query. + local allowed_engines_array=( avalanche2.0 avalanche3.0 goldsource idtech2 idtech3 idtech3_ql ioquake3 iw2.0 iw3.0 lwjgl2 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 unreal4 wurm ) + for allowed_engine in "${allowed_engines_array[@]}" + do + if [ "${allowed_engine}" == "${engine}" ]; then + if [ "${engine}" == "idtech3_ql" ]; then + local engine="quakelive" + elif [ "${shortname}" == "kf2" ]; then + local engine="unreal4" fi - done - else - fn_print_error "Checking session: " - fn_print_fail_eol_nl - fn_script_log_error "Checking session: FAIL" - alert="restart" - alert.sh - fn_script_log_info "Monitor is starting ${servername}" - sleep 1 - command_restart.sh - fi + + # Will first attempt to use gamedig then gsquery. + totalseconds=0 + if [ "${shortname}" == "wurm" ]; then + local query_methods_array=( gsquery ) + else + local query_methods_array=( gamedig gsquery ) + fi + for query_method in "${query_methods_array[@]}" + do + if [ "${query_method}" == "gamedig" ]; then + # Will bypass gamedig if not installed. + if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; then + if [ -z "${monitorpass}" ]; then + querymethod="${query_method}" + fn_monitor_loop + fi + fi + else + if [ -z "${monitorpass}" ]; then + querymethod="${query_method}" + fn_monitor_loop + fi + fi + done + fi + done +} + +fn_monitor_query_tcp(){ + querymethod="tcp" + fn_monitor_loop } +fn_monitor_query_upd(){ + querymethod="upd" + fn_monitor_loop +} + +monitorflag=1 fn_print_dots "${servername}" -sleep 1 check.sh logs.sh info_config.sh - +info_parms.sh fn_monitor_check_lockfile fn_monitor_check_update -fn_monitor_msg_checking -if [ "${gamename}" == "TeamSpeak 3" ]; then - fn_monitor_teamspeak3 -elif [ "${gamename}" == "Mumble" ]; then - fn_monitor_mumble +fn_monitor_check_session + +# Fix if lockfile is not unix time or contains letters +if [[ "$(cat "${rootdir}/${lockselfname}")" =~ [A-Za-z] ]]; then + date '+%s' > "${rootdir}/${lockselfname}" +fi + +# Add a query bypass if missing +if [ -z "${querydelay}" ]; then + querydelay="1" +fi + +# Query has to be enabled in Starbound config. +if [ "${shortname}" == "sb" ]; then + if [ "${queryenabled}" == "true" ]; then + fn_monitor_query + fi +elif [ "${shortname}" == "ts3" ]||[ "${shortname}" == "eco" ]||[ "${shortname}" == "mumble" ]; then + fn_monitor_query_tcp else - fn_monitor_tmux + fn_monitor_query fi + core_exit.sh diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh index 330374cf5..e0967117f 100644 --- a/lgsm/functions/command_postdetails.sh +++ b/lgsm/functions/command_postdetails.sh @@ -1,23 +1,19 @@ #!/bin/bash -# LGSM command_postdetails.sh function +# LinuxGSM command_postdetails.sh function # Author: CedarLUG # Contributor: CedarLUG -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Strips sensitive information out of Details output -local commandname="postdetails" +local commandname="POSTDETAILS" local commandaction="Postdetails" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" - -# postdetails variable affects the output of command_details.sh. Setting -# it here silences the output from sourcing command_details.sh. -postdetails=yes +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Set posttarget to the appropriately-defined post destination. # The options for posttarget are: # The default destination - hastebin -# posttarget="http://hastebin.com" +# posttarget="https://hastebin.com" # # Secondary destination - pastebin # posttarget="http://pastebin.com @@ -31,116 +27,91 @@ postdetails=yes # to post to pastebin, or # rustserver@gamerig:~$ posttarget= ./rustserver pd # to leave the output on the filesystem. -posttarget=${posttarget="http://hastebin.com"} +posttarget=${posttarget="https://hastebin.com"} # For pastebin, you can set the expiration period. # use 1 week as the default, other options are '24h' for a day, etc. -# This, too, may be overridden from the command line at the top-level -postexpire="${postexpire="1W"}" - -# This file sources the command_details.sh file to leverage all -# of the already-defined functions. To keep the command_details.sh -# from actually producing output, the main executable statements have -# been wrapped in the equivalent of an ifdef clause, that looks -# for the variable "postdetails" to be defined. -CedarLUG +# This, too, may be overridden from the command line at the top-level. +postexpire="${postexpire="30D"}" -# source all of the functions defined in the details command -command_details.sh - -# redefine as command_details.sh changes them -local commandname="postdetails" -local commandaction="Postdetails" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +# source all of the functions defined in the details command. +info_messages.sh -fn_bad_tmpfile() { - echo "There was a problem creating a temporary file ${tmpfile}." +fn_bad_postdetailslog() { + fn_print_fail_nl "Unable to create temporary file ${postdetailslog}." core_exit.sh } -# Rather than a one-pass sed parser, default to using a temporary directory -tmpfile="${tmpdir}/postdetails-$(date +"%Y-%d-%m_%H-%M-%S").tmp" - -touch "${tmpfile}" || fn_bad_tmpfile - -# fn_display_details is found in the command_details.sh file (which -# was sourced above). The output is parsed for passwords and other -# confidential information. -CedarLUG - -# The numerous sed lines could certainly be condensed quite a bit, -# but they are separated out to provide examples for how to add -# additional criteria in a straight-forward manner. -# (This was originally a sed one-liner.) -CedarLUG - -fn_display_details | sed -e 's/password="[^"]*/password="--stripped--/' | - sed -e 's/password "[^"]*/password "--stripped--/' | - sed -e 's/password: .*/password: --stripped--/' | - sed -e 's/gslt="[^"]*/gslt="--stripped--/' | - sed -e 's/gslt "[^"]*/gslt "--stripped--/' | - sed -e 's/pushbullettoken="[^"]*/pushbullettoken="--stripped--/' | - sed -e 's/pushbullettoken "[^"]*/pushbullettoken "--stripped--/' | - sed -e 's/authkey="[^"]*/authkey="--stripped--/' | - sed -e 's/authkey "[^"]*/authkey "--stripped--/' | - sed -e 's/authkey [A-Za-z0-9]\+/authkey --stripped--/' | - sed -e 's/rcts_strAdminPassword="[^"]*/rcts_strAdminPassword="--stripped--/' | - sed -e 's/rcts_strAdminPassword "[^"]*/rcts_strAdminPassword "--stripped--/' | - sed -e 's/sv_setsteamaccount [A-Za-z0-9]\+/sv_setsteamaccount --stripped--/' | - sed -e 's/sv_password="[^"]*/sv_password="--stripped--/' | - sed -e 's/sv_password "[^"]*/sv_password "--stripped--/' | - sed -e 's/zmq_stats_password="[^"]*/zmq_stats_password="--stripped--/' | - sed -e 's/zmq_stats_password "[^"]*/zmq_stats_password "--stripped--/' | - sed -e 's/zmq_rcon_password="[^"]*/zmq_rcon_password="--stripped--/' | - sed -e 's/zmq_rcon_password "[^"]*/zmq_rcon_password "--stripped--/' | - sed -e 's/pass="[^"]*/pass="--stripped--/' | - sed -e 's/pass "[^"]*/pass "--stripped--/' | - sed -e 's/rconServerPassword="[^"]*/rconServerPassword="--stripped--/' | - sed -e 's/rconServerPassword "[^"]*/rconServerPassword "--stripped--/' > "${tmpfile}" - -# strip off all console escape codes (colorization) -sed -i -r "s/[\x1B,\x0B]\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" "${tmpfile}" - -# If the gameserver uses anonymous steam credentials, leave them displayed -# in the output. Otherwise, strip these out as well. -if ! grep -q "^steampass[= ]\"\"" "${tmpfile}" ; then - sed -i -e 's/steampass[= ]"[^"]*/steampass "--stripped--/' "${tmpfile}" -fi -if ! grep -q "^steamuser[= ]\"anonymous\"" "${tmpfile}" ; then - sed -i -e 's/steamuser[= ]"[^"]*/steamuser "--stripped--/' "${tmpfile}" +# 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 [ -n "${alertflag}" ]; then + postdetailslog="${alertlog}" +else + # Run checks and gathers details to display. + check.sh + info_config.sh + info_parms.sh + info_distro.sh + info_messages.sh + query_gamedig.sh + touch "${postdetailslog}" || fn_bad_postdetailslog + { + fn_info_message_distro + fn_info_message_performance + fn_info_message_disk + 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}" != "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 if [ "${posttarget}" == "http://pastebin.com" ] ; then fn_print_dots "Posting details to pastbin.com for ${postexpire}" - sleep 1 # grab the return from 'value' from an initial visit to pastebin. - csrftoken=$(curl -s "${posttarget}" | + csrftoken=$(${curlpath} -s "${posttarget}" | sed -n 's/^.*input type="hidden" name="csrf_token_post" value="\(.*\)".*$/\1/p') # # Use the csrftoken to then post the content. # - link=$(curl -s "${posttarget}/post.php" -D - -F "submit_hidden=submit_hidden" \ + link=$(${curlpath} -s "${posttarget}/post.php" -D - -F "submit_hidden=submit_hidden" \ -F "post_key=${csrftoken}" -F "paste_expire_date=${postexpire}" \ -F "paste_name=${gamename} Debug Info" \ -F "paste_format=8" -F "paste_private=0" \ - -F "paste_type=bash" -F "paste_code=<${tmpfile}" | + -F "paste_type=bash" -F "paste_code=<${postdetailslog}" | awk '/^location: / { print $2 }' | sed "s/\n//g") # Output the resulting link. fn_print_ok_nl "Posting details to pastbin.com for ${postexpire}" - echo " * url: ${posttarget}${link}" -elif [ "${posttarget}" == "http://hastebin.com" ] ; then - fn_print_dots "Posting details to hastebin.com for ${postexpire}" - sleep 1 + pdurl="${posttarget}${link}" + echo " Please share the following url for support: ${pdurl}" +elif [ "${posttarget}" == "https://hastebin.com" ] ; then + fn_print_dots "Posting details to hastebin.com" # hastebin is a bit simpler. If successful, the returned result # should look like: {"something":"key"}, putting the reference that # we need in "key". TODO - error handling. -CedarLUG - link=$(curl -s -d "$(<${tmpfile})" "${posttarget}/documents" | cut -d\" -f4) + link=$(${curlpath} -H "HTTP_X_REQUESTED_WITH:XMLHttpRequest" -s -d "$(<${postdetailslog})" "${posttarget}/documents" | cut -d\" -f4) fn_print_ok_nl "Posting details to hastebin.com for ${postexpire}" - echo " * url: ${posttarget}/${link}" + pdurl="${posttarget}/${link}" + echo " Please share the following url for support: ${pdurl}" else - fn_print_warn_nl Review the output in "${tmpfile}" + fn_print_warn_nl "Review output in: ${postdetailslog}" core_exit.sh fi -# cleanup -rm "${tmpfile}" || /bin/true -core_exit.sh +if [ -z "${alertflag}" ]; then + core_exit.sh +else + alerturl="${pdurl}" +fi diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh index eacebaaea..db8678bb5 100644 --- a/lgsm/functions/command_restart.sh +++ b/lgsm/functions/command_restart.sh @@ -1,12 +1,12 @@ #!/bin/bash -# LGSM command_restart.sh function +# LinuxGSM command_restart.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Restarts the server. local commandname="RESTART" local commandaction="Restarting" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_config.sh exitbypass=1 diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 30bbfccc8..ed7d98498 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -1,13 +1,13 @@ #!/bin/bash -# LGSM command_start.sh function +# LinuxGSM command_start.sh function # Author: Daniel Gibbs # Contributor: UltimateByte -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Starts the server. local commandname="START" local commandaction="Starting" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_start_teamspeak3(){ if [ ! -e "${servercfgfullpath}" ]; then @@ -15,38 +15,38 @@ fn_start_teamspeak3(){ fn_script_log_warn "${servercfgfullpath} is missing" echo " * Creating blank ${servercfg}" fn_script_log_info "Creating blank ${servercfg}" - sleep 2 + fn_sleep_time echo " * ${servercfg} can remain blank by default." fn_script_log_info "${servercfgfullpath} can remain blank by default." - sleep 2 + fn_sleep_time echo " * ${servercfg} is located in ${servercfgfullpath}." fn_script_log_info "${servercfg} is located in ${servercfgfullpath}." sleep 5 touch "${servercfgfullpath}" fi - sleep 1 - check_status.sh - if [ "${status}" != "0" ]; then - fn_print_info_nl "${servername} is already running" - fn_script_log_error "${servername} is already running" - core_exit.sh + fn_sleep_time + if [ -f "${lgsmlog}" ]; then + mv "${lgsmlog}" "${lgsmlogdate}" fi + # Create lockfile. - mv "${scriptlog}" "${scriptlogdate}" - # Create lockfile - date > "${rootdir}/${lockselfname}" + date '+%s' > "${rootdir}/${lockselfname}" + # Accept license. + if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then + install_eula.sh + fi cd "${executabledir}" - if [ "${ts3serverpass}" == "1" ];then + if [ "${ts3serverpass}" == "1" ]; then ./ts3server_startscript.sh start serveradmin_password="${newpassword}" inifile="${servercfgfullpath}" > /dev/null 2>&1 else ./ts3server_startscript.sh start inifile="${servercfgfullpath}" > /dev/null 2>&1 fi - sleep 1 + fn_sleep_time check_status.sh if [ "${status}" == "0" ]; then fn_print_fail_nl "Unable to start ${servername}" fn_script_log_fatal "Unable to start ${servername}" - echo -e " Check log files: ${rootdir}/log" + echo -e " Check log files: ${logdir}" core_exit.sh else fn_print_ok_nl "${servername}" @@ -55,79 +55,102 @@ fn_start_teamspeak3(){ } fn_start_tmux(){ - fn_parms - - # Log rotation - check_status.sh - if [ "${status}" == "0" ]; then - fn_script_log_info "Rotating log files" - if [ "${engine}" == "unreal2" ]; then - if [ -f "${gamelog}" ]; then - mv "${gamelog}" "${gamelogdate}" - fi - fi - mv "${scriptlog}" "${scriptlogdate}" - mv "${consolelog}" "${consolelogdate}" + 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 - # If server is already running exit - check_status.sh - if [ "${status}" != "0" ]; then - fn_print_info_nl "${servername} is already running" - fn_script_log_error "${servername} is already running" - core_exit.sh + # 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 > "${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 "https://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" - echo "Currently installed: $(tmux -V)" >> "${consolelog}" - - # Console logging disabled: Bug in tmux 1.8 breaks logging - 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 "https://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" - echo "Currently installed: $(tmux -V)" >> "${consolelog}" - - # Console logging enable or not set - elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then - touch "${consolelog}" - tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'" - - # Console logging disabled - elif [ "${consolelogging}" == "off" ]; then - touch "${consolelog}" - cat "Console logging disabled by user" >> "{consolelog}" - fn_script_log_info "Console logging disabled by user" + tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${servicename}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${servicename}-tmux-error.tmp" + + # Create logfile. + touch "${consolelog}" + + # 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 "Tmux version: master (user compiled)" >> "${consolelog}" + if [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then + tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'" + fi + elif [ -n "${tmuxversion}" ]; then + # Get the digit version of tmux. + 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 "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 "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 "${servicename}" "exec cat >> '${consolelog}'" + fi + else + echo "Unable to detect tmux version" >> "${consolelog}" + fn_script_log_warn "Unable to detect tmux version" fi - sleep 1 - # If the server fails to start +# Console logging disabled. +if [ "${consolelogging}" == "off" ]; then + echo "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}" - sleep 1 - if [ -s "${scriptlogdir}/.${servicename}-tmux-error.tmp" ]; then + if [ -s "${lgsmlogdir}/.${servicename}-tmux-error.tmp" ]; then fn_print_fail_nl "Unable to start ${servername}: Tmux error:" fn_script_log_fatal "Unable to start ${servername}: Tmux error:" echo "" echo "Command" echo "=================================" - echo "tmux new-session -d -s \"${servicename}\" \"${executable} ${parms}\"" | tee -a "${scriptlog}" + echo "tmux new-session -d -s \"${servicename}\" \"${executable} ${parms}\"" | tee -a "${lgsmlog}" echo "" echo "Error" echo "=================================" - cat "${scriptlogdir}/.${servicename}-tmux-error.tmp" | tee -a "${scriptlog}" + cat "${lgsmlogdir}/.${servicename}-tmux-error.tmp" | tee -a "${lgsmlog}" - # Detected error https://gameservermanagers.com/issues - if [ $(grep -c "Operation not permitted" "${scriptlogdir}/.${servicename}-tmux-error.tmp") ]; then + # Detected error https://linuxgsm.com/support + if grep -c "Operation not permitted" "${lgsmlogdir}/.${servicename}-tmux-error.tmp" + then echo "" echo "Fix" echo "=================================" @@ -143,13 +166,13 @@ fn_start_tmux(){ echo "" echo " usermod -G tty $(whoami)" echo "" - echo "https://gameservermanagers.com/tmux-op-perm" - fn_script_log_info "https://gameservermanagers.com/tmux-op-perm" + echo "https://linuxgsm.com/tmux-op-perm" + fn_script_log_info "https://linuxgsm.com/tmux-op-perm" else echo "No known fix currently. Please log an issue." fn_script_log_info "No known fix currently. Please log an issue." - echo "https://gameservermanagers.com/issues" - fn_script_log_info "https://gameservermanagers.com/issues" + echo "https://linuxgsm.com/support" + fn_script_log_info "https://linuxgsm.com/support" fi fi fi @@ -159,26 +182,35 @@ fn_start_tmux(){ fn_print_ok "${servername}" fn_script_log_pass "Started ${servername}" fi - rm "${scriptlogdir}/.${servicename}-tmux-error.tmp" + rm "${lgsmlogdir}/.${servicename}-tmux-error.tmp" echo -en "\n" } fn_print_dots "${servername}" -sleep 1 check.sh -fix.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_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 logs.sh -# Will check for updates is updateonstart is yes -if [ "${status}" == "0" ]; then - if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then - exitbypass=1 - command_update.sh - fi +# Will check for updates is updateonstart is yes. +if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then + exitbypass=1 + unset updateonstart + command_update.sh fi -if [ "${gamename}" == "TeamSpeak 3" ]; then +if [ "${shortname}" == "ts3" ]; then fn_start_teamspeak3 else fn_start_tmux diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 95aa10536..ad3b64882 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -1,240 +1,251 @@ #!/bin/bash -# LGSM command_stop.sh function +# LinuxGSM command_stop.sh function # Author: Daniel Gibbs # Contributors: UltimateByte -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Stops the server. local commandname="STOP" local commandaction="Stopping" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# Attempts graceful of source using rcon 'quit' command. -fn_stop_graceful_source(){ - fn_print_dots "Graceful: rcon quit" - fn_script_log_info "Graceful: rcon quit" - # sends quit - tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1 - # waits up to 30 seconds giving the server time to shutdown gracefuly +# 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 "${servicename}" 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: rcon quit: ${seconds}: " + 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 + fn_sleep_time +} + +# Attempts graceful shutdown by sending a specified command. +# Usage: fn_stop_graceful_cmd "console_command" "timeout_in_seconds" +# e.g.: fn_stop_graceful_cmd "quit" "30" +fn_stop_graceful_cmd(){ + fn_print_dots "Graceful: sending \"${1}\"" + fn_script_log_info "Graceful: sending \"${1}\"" + # Sends specific stop command. + tmux send -t "${servicename}" "${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: rcon quit: OK: ${seconds} seconds" + fn_script_log_pass "Graceful: sending \"${1}\": OK: ${seconds} seconds" break fi sleep 1 - fn_print_dots "Graceful: rcon quit: ${seconds}" + fn_print_dots "Graceful: sending \"${1}\": ${seconds}" done check_status.sh if [ "${status}" != "0" ]; then - fn_print_error "Graceful: rcon quit: " + fn_print_error "Graceful: sending \"${1}\": " fn_print_fail_eol_nl - fn_script_log_error "Graceful: rcon quit: FAIL" + fn_script_log_error "Graceful: sending \"${1}\": FAIL" fi - sleep 1 - fn_stop_tmux + fn_sleep_time } -# Attempts graceful of goldsource using rcon 'quit' command. -# Goldsource 'quit' command restarts rather than shutsdown -# this function will only wait 3 seconds then force a tmux shutdown. -# preventing the server from coming back online. +# Attempts graceful shutdown of goldsource using rcon 'quit' command. +# There is only a 3 second delay before a forced a tmux shutdown +# as Goldsource servers 'quit' command does a restart rather than shutdown. fn_stop_graceful_goldsource(){ - fn_print_dots "Graceful: rcon quit" - fn_script_log_info "Graceful: rcon quit" + fn_print_dots "Graceful: sending \"quit\"" + fn_script_log_info "Graceful: sending \"quit\"" # sends quit tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1 - # waits 3 seconds as goldsource servers restart with the quit command + # Waits 3 seconds as goldsource servers restart with the quit command. for seconds in {1..3}; do sleep 1 - fn_print_dots "Graceful: rcon quit: ${seconds}" + fn_print_dots "Graceful: sending \"quit\": ${seconds}" done - fn_print_ok "Graceful: rcon quit: ${seconds}: " + fn_print_ok "Graceful: sending \"quit\": ${seconds}: " fn_print_ok_eol_nl - fn_script_log_pass "Graceful: rcon quit: OK: ${seconds} seconds" - sleep 1 - fn_stop_tmux + fn_script_log_pass "Graceful: sending \"quit\": OK: ${seconds} seconds" } -# Attempts graceful of 7 Days To Die using telnet. fn_stop_telnet_sdtd(){ - 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" - ') + 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" - sleep 1 if [ "${telnetenabled}" == "false" ]; then fn_print_info_nl "Graceful: telnet: DISABLED: Enable in ${servercfg}" - elif [ "$(command -v expect)" ]||[ "$(which expect >/dev/null 2>&1)" ]; then + elif [ "$(command -v expect 2>/dev/null)" ]; then # Tries to shutdown with both localhost and server IP. for telnetip in 127.0.0.1 ${ip}; do - fn_print_dots "Graceful: telnet: ${telnetip}" - fn_script_log_info "Graceful: telnet: ${telnetip}" - sleep 1 + fn_print_dots "Graceful: telnet: ${telnetip}:${telnetport}" + fn_script_log_info "Graceful: telnet: ${telnetip}:${telnetport}" fn_stop_telnet_sdtd - completed=$(echo -en "\n ${sdtd_telnet_shutdown}"|grep "Completed.") - refused=$(echo -en "\n ${sdtd_telnet_shutdown}"|grep "Timeout or EOF") + completed=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Completed.") + refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF") if [ -n "${refused}" ]; then - fn_print_error "Graceful: telnet: ${telnetip}: " + fn_print_error "Graceful: telnet: ${telnetip}:${telnetport} : " fn_print_fail_eol_nl - fn_script_log_error "Graceful: telnet: ${telnetip}: FAIL" - sleep 1 + fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport} : FAIL" elif [ -n "${completed}" ]; then break fi done - # If telnet was successful will use telnet again to check the connection has closed - # This confirms that the tmux session can now be killed. + # If telnet shutdown was successful will use telnet again to check + # the connection has closed, confirming that the tmux session can now be killed. if [ -n "${completed}" ]; then for seconds in {1..30}; do fn_stop_telnet_sdtd - refused=$(echo -en "\n ${sdtd_telnet_shutdown}"|grep "Timeout or EOF") + refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF") if [ -n "${refused}" ]; then - fn_print_ok "Graceful: telnet: ${telnetip}: " + fn_print_ok "Graceful: telnet: ${telnetip}:${telnetport} : " fn_print_ok_eol_nl - fn_script_log_pass "Graceful: telnet: ${telnetip}: ${seconds} seconds" + fn_script_log_pass "Graceful: telnet: ${telnetip}:${telnetport} : ${seconds} seconds" break fi sleep 1 - fn_print_dots "Graceful: rcon quit: ${seconds}" + fn_print_dots "Graceful: telnet: ${seconds}" done - # If telnet failed will go straight to tmux shutdown. - # If cannot shutdown correctly world save may be lost + # If telnet shutdown fails tmux shutdown will be used, this risks loss of world save. else if [ -n "${refused}" ]; then fn_print_error "Graceful: telnet: " fn_print_fail_eol_nl - fn_script_log_error "Graceful: telnet: ${telnetip}: FAIL" + 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 "${scriptlog}" - echo -en "Telnet output:" | tee -a "${scriptlog}" - echo -en "\n ${sdtd_telnet_shutdown}" | tee -a "${scriptlog}" - echo -en "\n\n" | tee -a "${scriptlog}" + 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 - sleep 1 - fn_stop_tmux -} - -# Attempts graceful of source using rcon '/stop' command. -fn_stop_graceful_minecraft(){ - fn_print_dots "Graceful: console /stop" - fn_script_log_info "Graceful: console /stop" - # sends quit - tmux send -t "${servicename}" /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: console /stop: ${seconds}: " - fn_print_ok_eol_nl - fn_script_log_pass "Graceful: console /stop: OK: ${seconds} seconds" - break - fi - sleep 1 - fn_print_dots "Graceful: console /stop: ${seconds}" - done - check_status.sh - if [ "${status}" != "0" ]; then - fn_print_error "Graceful: console /stop: " - fn_print_fail_eol_nl - fn_script_log_error "Graceful: console /stop: FAIL" - fi - sleep 1 - fn_stop_tmux + fn_sleep_time } fn_stop_graceful_select(){ - if [ "${gamename}" == "7 Days To Die" ]; then + if [ "${shortname}" == "sdtd" ]; then fn_stop_graceful_sdtd - elif [ "${engine}" == "source" ]; then - fn_stop_graceful_source + elif [ "${engine}" == "spark" ]; then + fn_stop_graceful_cmd "q" 30 + elif [ "${shortname}" == "terraria" ]; then + fn_stop_graceful_cmd "exit" 30 + elif [ "${shortname}" == "mc" ]; then + fn_stop_graceful_cmd "stop" 30 + elif [ "${shortname}" == "mta" ]; then + # Long wait time required for mta + # as resources shutdown individually. + fn_stop_graceful_cmd "quit" 120 elif [ "${engine}" == "goldsource" ]; then fn_stop_graceful_goldsource - elif [ "${engine}" == "lwjgl2" ]; then - fn_stop_graceful_minecraft - else - fn_stop_tmux + elif [ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${shortname}" == "fctr" ]||[ "${shortname}" == "mumble" ]||[ "${shortname}" == "wurm" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "jc3" ]; then + fn_stop_graceful_ctrlc + elif [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]||[ "${shortname}" == "pz" ]||[ "${shortname}" == "rw" ]; then + fn_stop_graceful_cmd "quit" 30 fi } fn_stop_ark(){ - maxpiditer=15 # The maximum number of times to check if the ark pid has closed gracefully. - info_config.sh - if [ -z "${queryport}" ]; then - fn_print_warn "No queryport found using info_config.sh" - fn_script_log_warn "No queryport found using info_config.sh" - userconfigfile="${filesdir}" - userconfigfile+="/ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini" - queryport=$(grep ^QueryPort= ${userconfigfile} | cut -d= -f2 | sed "s/[^[:digit:].*].*//g") - fi - if [ -z "${queryport}" ]; then - fn_print_warn "No queryport found in the GameUsersettings.ini file" - fn_script_log_warn "No queryport found in the GameUsersettings.ini file" - return - fi + # The maximum number of times to check if the ark pid has closed gracefully. + maxpiditer=15 + info_config.sh + if [ -z "${queryport}" ]; then + fn_print_warn "No queryport found using info_config.sh" + fn_script_log_warn "No queryport found using info_config.sh" + userconfigfile="${serverfiles}" + userconfigfile+="/ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini" + queryport=$(grep ^QueryPort= ${userconfigfile} | cut -d= -f2 | sed "s/[^[:digit:].*].*//g") + fi + if [ -z "${queryport}" ]; then + fn_print_warn "No queryport found in the GameUsersettings.ini file" + fn_script_log_warn "No queryport found in the GameUsersettings.ini file" + return + fi - if [[ ${#queryport} -gt 0 ]] ; then - for (( pidcheck=0 ; pidcheck < ${maxpiditer} ; pidcheck++ )) ; do - pid=$(netstat -nap 2>/dev/null | grep ^udp[[:space:]] |\ - grep :${queryport}[[:space:]] | rev | awk '{print $1}' |\ - rev | cut -d\/ -f1) - # - # check for a valid pid - pid=${pid//[!0-9]/} - let pid+=0 # turns an empty string into a valid number, '0', - # and a valid numeric pid remains unchanged. - if [[ ${pid} -gt 1 && $pid -le $(cat /proc/sys/kernel/pid_max) ]] ; then - fn_print_dots "Process still bound. Awaiting graceful exit: ${pidcheck}" - sleep 1 - else - break # Our job is done here - fi # end if for pid range check - done - if [[ ${pidcheck} -eq ${maxpiditer} ]] ; then - # The process doesn't want to close after 20 seconds. - # kill it hard. - fn_print_error "Terminating reluctant Ark process: ${pid}" - kill -9 $pid - fi - fi # end if for port check -} # end of fn_stop_ark + if [ "${#queryport}" -gt 0 ] ; then + for (( pidcheck=0 ; pidcheck < ${maxpiditer} ; pidcheck++ )) ; do + pid=$(netstat -nap 2>/dev/null | grep "^udp[[:space:]]" | grep ":${queryport}[[:space:]]" | rev | awk '{print $1}' | rev | cut -d\/ -f1) + # Check for a valid pid. + pid=${pid//[!0-9]/} + let pid+=0 # turns an empty string into a valid number, '0', + # and a valid numeric pid remains unchanged. + if [ "${pid}" -gt 1 ]&&[ "${pid}" -le "$(cat "/proc/sys/kernel/pid_max")" ]; then + fn_print_dots "Process still bound. Awaiting graceful exit: ${pidcheck}" + else + break + fi + done + if [[ ${pidcheck} -eq ${maxpiditer} ]] ; then + # The process doesn't want to close after 20 seconds. + # kill it hard. + fn_print_error "Terminating reluctant Ark process: ${pid}" + kill -9 ${pid} + fi + fi +} fn_stop_teamspeak3(){ fn_print_dots "${servername}" - sleep 1 - ${filesdir}/ts3server_startscript.sh stop > /dev/null 2>&1 + "${serverfiles}"/ts3server_startscript.sh stop > /dev/null 2>&1 check_status.sh if [ "${status}" == "0" ]; then - # Remove lockfile rm -f "${rootdir}/${lockselfname}" fn_print_ok_nl "${servername}" fn_script_log_pass "Stopped ${servername}" @@ -244,80 +255,52 @@ fn_stop_teamspeak3(){ fi } -fn_stop_mumble(){ - # Get needed port info - info_config.sh - fn_print_dots "Stopping ${servername}" - mumblepid=$(netstat -nap 2>/dev/null | grep udp | grep "${port}" | grep murmur | awk '{ print $6 }' | awk -F'/' '{ print $1 }') - kill ${mumblepid} - sleep 1 - check_status.sh - if [ "${status}" == "0" ]; then - # Remove lockfile - rm -f "${rootdir}/${lockselfname}" - fn_stop_tmux - fn_script_log_pass "Stopped ${servername}" - else - fn_print_fail_nl "Unable to stop ${servername}" - fn_script_log_error "Unable to stop ${servername}" - fi -} - fn_stop_tmux(){ fn_print_dots "${servername}" fn_script_log_info "tmux kill-session: ${servername}" - sleep 1 # Kill tmux session tmux kill-session -t "${servicename}" > /dev/null 2>&1 - sleep 0.5 + fn_sleep_time check_status.sh if [ "${status}" == "0" ]; then - # Remove lockfile - rm -f "${rootdir}/${lockselfname}" - # ARK doesn't clean up immediately after tmux is killed. - # Make certain the ports are cleared before continuing. - if [ "${gamename}" == "ARK: Survivial Evolved" ]; then - fn_stop_ark - echo -en "\n" - fi + # ARK does not clean up immediately after tmux is killed. + # Make certain the ports are cleared before continuing. + if [ "${shortname}" == "ark" ]; then + fn_stop_ark + fi fn_print_ok_nl "${servername}" fn_script_log_pass "Stopped ${servername}" else - fn_print_fail_nl "Unable to stop${servername}" - fn_script_log_fatal "Unable to stop${servername}" + fn_print_fail_nl "Unable to stop ${servername}" + fn_script_log_fatal "Unable to stop ${servername}" fi } -# checks if the server is already stopped before trying to stop. +# Checks if the server is already stopped. fn_stop_pre_check(){ - if [ "${gamename}" == "TeamSpeak 3" ]; then - check_status.sh - if [ "${status}" == "0" ]; then - fn_print_info_nl "${servername} is already stopped" - fn_script_log_error "${servername} is already stopped" - else - fn_stop_teamspeak3 - fi - elif [ "${gamename}" == "Mumble" ]; then - if [ "${status}" == "0" ]; then - fn_print_info_nl "${servername} is already stopped" - fn_script_log_error "${servername} is already stopped" - else - fn_stop_mumble - fi + if [ "${status}" == "0" ]; then + fn_print_info_nl "${servername} is already stopped" + fn_script_log_error "${servername} is already stopped" + elif [ "${shortname}" == "ts3" ]; then + fn_stop_teamspeak3 else - if [ "${status}" == "0" ]; then - fn_print_info_nl "${servername} is already stopped" - fn_script_log_error "${servername} is already stopped" - else - fn_stop_graceful_select - fi + fn_stop_graceful_select + fi + # Check status again, a stop tmux session if needed. + check_status.sh + if [ "${status}" != "0" ]; then + fn_stop_tmux fi } fn_print_dots "${servername}" -sleep 1 check.sh info_config.sh fn_stop_pre_check -core_exit.sh +# Remove lockfile. +if [ -f "${rootdir}/${lockselfname}" ]; then + rm -f "${rootdir}/${lockselfname}" +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 index 2f9749200..014e082b2 100644 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/functions/command_test_alert.sh @@ -1,15 +1,14 @@ #!/bin/bash -# LGSM command_test_alert.sh function +# LinuxGSM command_test_alert.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Sends a test alert. local commandname="ALERT" local commandaction="Alert" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "${servername}" -sleep 1 check.sh info_config.sh alert="test" diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh index 1a9896889..f1b18560e 100644 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -1,56 +1,44 @@ #!/bin/bash -# LGSM command_ts3_server_pass.sh function +# LinuxGSM command_ts3_server_pass.sh function # Author: Daniel Gibbs # Contributor : UltimateByte -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Changes TS3 serveradmin password. local commandname="TS3-CHANGE-PASS" -local commandaction="TS3 Change Password" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" - +local commandaction="ServerAdmin Password Change" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_serveradmin_password_prompt(){ - echo "" - echo "${gamename} ServerAdmin Password Change" - echo "=================================" - echo "" + fn_print_header echo "Press \"CTRL+b d\" to exit console." fn_print_information_nl "You are about to change the ${gamename} ServerAdmin password." fn_print_warning_nl "${gamename} will restart during this process." echo "" - while true; do - read -e -i "y" -p "Continue? [Y/n]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) echo Exiting; exit;; - * ) echo "Please answer yes or no.";; - esac - done + if ! fn_prompt_yn "Continue?" Y; then + echo Exiting; exit + fi fn_script_log_info "Initiating ${gamename} ServerAdmin password change" - read -p "Enter new password : " newpassword + read -rp "Enter new password : " newpassword } - fn_serveradmin_password_set(){ fn_print_info_nl "Starting server with new password..." fn_script_log_info "Starting server with new password" - sleep 1 - # Start server in "new password mode" + # Start server in "new password mode". ts3serverpass="1" exitbypass="1" command_start.sh fn_print_ok_nl "Password applied" fn_script_log_pass "New ServerAdmin password applied" - sleep 1 } -# Running functions +# Running functions. check.sh fn_serveradmin_password_prompt check_status.sh if [ "${status}" != "0" ]; then - # Stop any running server + # Stop any running server. exitbypass="1" command_stop.sh fn_serveradmin_password_set diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index bffa4e6ea..c3c289d97 100644 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -1,24 +1,27 @@ #!/bin/bash -# LGSM command_update.sh function +# LinuxGSM command_update.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Handles updating of servers. local commandname="UPDATE" local commandaction="Update" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "" -sleep 0.5 check.sh +logs.sh - -if [ "${gamename}" == "TeamSpeak 3" ]; then +if [ "${shortname}" == "ts3" ]; then update_ts3.sh -elif [ "${engine}" == "lwjgl2" ]; then +elif [ "${shortname}" == "mc" ]; then update_minecraft.sh -elif [ "${gamename}" == "Mumble" ]; then +elif [ "${shortname}" == "mumble" ]; then update_mumble.sh +elif [ "${shortname}" == "fctr" ]; then + update_factorio.sh +elif [ "${shortname}" == "mta" ]; then + update_mta.sh else update_steamcmd.sh fi diff --git a/lgsm/functions/command_update_functions.sh b/lgsm/functions/command_update_functions.sh index 538a8dee8..33609b121 100644 --- a/lgsm/functions/command_update_functions.sh +++ b/lgsm/functions/command_update_functions.sh @@ -1,61 +1,13 @@ #!/bin/bash -# LGSM command_update_functions.sh function +# LinuxGSM command_update_functions.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Deletes the functions dir to allow re-downloading of functions from GitHub. +# Legacy Command -local commandaction="Update LGSM" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +command_update_linuxgsm.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} -fn_print_dots "Updating functions" -sleep 1 -check.sh -fn_script_log_info "Updating functions" -echo -ne "\n" - -# Removed legacy functions dir -if [ -n "${rootdir}" ]; then - if [ -d "${rootdir}/functions/" ]; then - rm -rfv "${rootdir}/functions/" - exitcode=$? - fi -fi - -if [ -n "${functionsdir}" ]; then - if [ -d "${functionsdir}" ]; then - cd "${functionsdir}" - for functionfile in * - do - # Check if curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - curlcmd=${curlcmd} - break - fi - done - - echo -ne " checking ${functionfile}...\c" - function_file_diff=$(diff "${functionsdir}/${functionfile}" <(${curlcmd} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")) - if [ "${function_file_diff}" != "" ]; then - fn_print_update_eol_nl - fn_script_log_info "checking ${functionfile}: UPDATE" - rm -rf "${functionsdir}/${functionfile}" - fn_update_function - else - fn_print_ok_eol_nl - fi - done - fi -fi - -if [ "${exitcode}" != "0" ]&&[ -n "${exitcode}" ]; then - fn_print_fail "Updating functions" - fn_script_log_fatal "Updating functions" -else - fn_print_ok "Updating functions" - fn_script_log_pass "Updating functions" -fi -echo -ne "\n" -core_exit.sh \ No newline at end of file +command_update_linuxgsm.sh \ No newline at end of file diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh new file mode 100644 index 000000000..4a70c7748 --- /dev/null +++ b/lgsm/functions/command_update_linuxgsm.sh @@ -0,0 +1,116 @@ +#!/bin/bash +# LinuxGSM command_update_linuxgsm.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Deletes the functions dir to allow re-downloading of functions from GitHub. + +local commandname="UPDATE LINUXGSM" +local commandaction="Update LinuxGSM" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_print_dots "Updating LinuxGSM" +check.sh +fn_script_log_info "Updating LinuxGSM" +echo -en "\n" + +if [ -z "${legacymode}" ]; then + # Check and update _default.cfg. + echo -en " checking config _default.cfg...\c" + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) + if [ "${config_file_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log_info "checking config _default.cfg: UPDATE" + rm -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" + fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforce" "nomd5" + alert="config" + alert.sh + else + fn_print_ok_eol_nl + fn_script_log_info "checking config _default.cfg: OK" + fi + + echo -en " checking linuxgsm.sh...\c" + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) + if [ "${tmp_script_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log_info "checking linuxgsm.sh: UPDATE" + rm -f "${tmpdir}/linuxgsm.sh" + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "nochmodx" "norun" "noforcedl" "nomd5" + # Compare selfname against linuxgsm.sh in the tmp dir. Ignoring server specific vars. + else + fn_script_log_info "checking linuxgsm.sh: OK" + fn_print_ok_eol_nl + fi + echo -en " checking ${selfname}...\c" + 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 + echo -en " backup ${selfname}...\c" + mkdir -p "${backupdir}/script/" + cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" + if [ $? -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + echo -e " Backup: ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" + fi + echo -en " fetching ${selfname}...\c" + 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}" + if [ $? -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + else + fn_print_ok_eol_nl + fi +fi + +# Check and update functions. +if [ -n "${functionsdir}" ]; then + if [ -d "${functionsdir}" ]; then + cd "${functionsdir}" || exit + for functionfile in * + do + echo -en " checking function ${functionfile}...\c" + github_file_url_dir="lgsm/functions" + get_function_file=$(${curlpath} --fail -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}") + exitcode=$? + function_file_diff=$(diff "${functionsdir}/${functionfile}" <(${curlpath} --fail -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")) + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + echo -en " removing unknown function ${functionfile}...\c" + fn_script_log_fatal "removing unknown function ${functionfile}" + rm -f "${functionfile}" + if [ $? -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + elif [ "${function_file_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log_info "checking function ${functionfile}: UPDATE" + rm -rf "${functionsdir:?}/${functionfile}" + fn_update_function + else + fn_print_ok_eol_nl + fi + done + fi +fi + +if [ "${exitcode}" != "0" ]&&[ -n "${exitcode}" ]; then + fn_print_fail "Updating functions" + fn_script_log_fatal "Updating functions" +else + fn_print_ok "Updating functions" + fn_script_log_pass "Updating functions" +fi +echo -en "\n" +core_exit.sh diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh index 9e7d20c67..e252bc7f6 100644 --- a/lgsm/functions/command_validate.sh +++ b/lgsm/functions/command_validate.sh @@ -1,34 +1,35 @@ #!/bin/bash -# LGSM command_validate.sh function +# LinuxGSM command_validate.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Runs a server validation. local commandname="VALIDATE" local commandaction="Validate" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_validation(){ - echo -e " * Validating may overwrite some customised files." - echo -en " * https://developer.valvesoftware.com/wiki/SteamCMD#Validate" - sleep 3 - echo -en "\n" - + fn_print_info "Validating files: SteamCMD" + echo "" + echo -e "* Validating may overwrite some customised files." + echo -e "* https://docs.linuxgsm.com/commands/validate" fn_script_log_info "Validating files: SteamCMD" - sleep 1 - - cd "${rootdir}/steamcmd" - - if [ $(command -v stdbuf) ]; then + sleep 3 + cd "${steamcmddir}" || exit + # Detects if unbuffer command is available for 32 bit distributions only. + info_distro.sh + if [ "$(command -v stdbuf)" ]&&[ "${arch}" != "x86_64" ]; then unbuffer="stdbuf -i0 -o0 -e0" fi - if [ "${engine}" == "goldsource" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" ${branch} +app_update "${appid}" ${branch} validate +quit| tee -a "${scriptlog}" + if [ "${appid}" == "90" ]; then + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}" + elif [ "${gamename}" == "Unturned" ]; then + ${unbuffer} ./steamcmd.sh +@sSteamCmdForcePlatformBitness 32 +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} validate +quit elif [ "${gamename}" == "Jedi Knight II: Jedi Outcast" ]; ${unbuffer} ./steamcmd.sh +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} validate +quit| tee -a "${scriptlog}" else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} validate +quit| tee -a "${scriptlog}" + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}" fi if [ $? != 0 ]; then fn_print_fail_nl "Validating files: SteamCMD" @@ -42,15 +43,13 @@ fn_validation(){ } fn_print_dots "Validating files:" -sleep 0.5 fn_print_dots "Validating files: SteamCMD" -sleep 1 check.sh check_status.sh if [ "${status}" != "0" ]; then exitbypass=1 command_stop.sh - fn_validation + fn_validation "${appid}" exitbypass=1 command_start.sh else diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh new file mode 100644 index 000000000..12e85d90d --- /dev/null +++ b/lgsm/functions/command_wipe.sh @@ -0,0 +1,206 @@ +#!/bin/bash +# LinuxGSM command_backup.sh function +# Author: Daniel Gibbs +# Contributor: UltimateByte +# Website: https://linuxgsm.com +# Description: Wipes server data, useful after updates for some games like Rust + +local commandname="WIPE" +local commandaction="Wipe" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +check.sh +fn_print_header +fn_script_log "Entering ${gamename} ${commandaction}" + +# Process to server wipe. +fn_wipe_server_process(){ + check_status.sh + if [ "${status}" != "0" ]; then + exitbypass=1 + command_stop.sh + fn_wipe_server_remove_files + exitbypass=1 + command_start.sh + else + fn_wipe_server_remove_files + fi + echo "server data wiped" + fn_script_log "server data wiped." +} + +# Provides an exit code upon error. +fn_wipe_exit_code(){ + ((exitcode=$?)) + if [ ${exitcode} -ne 0 ]; then + fn_script_log_fatal "${currentaction}" + core_exit.sh + else + fn_print_ok_eol_nl + fi +} + +# Removes files to wipe server. +fn_wipe_server_remove_files(){ + # Rust Wipe. + if [ "${shortname}" == "rust" ]; then + # Wipe pocedural map. + if [ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap.*.map")" ]; then + currentaction="Removing map file(s): ${serveridentitydir}/proceduralmap.*.map" + echo -en "Removing procedural map proceduralmap.*.map file(s)..." + fn_sleep_time + fn_script_log "${currentaction}" + find "${serveridentitydir:?}" -type f -name "proceduralmap.*.map" -delete + fn_wipe_exit_code + fn_sleep_time + else + fn_print_information_nl "No procedural map file to remove" + fn_script_log_info "No procedural map file to remove." + fi + # Wipe procedural map save. + if [ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap.*.sav")" ]; then + currentaction="Removing procedural map save(s): ${serveridentitydir}/proceduralmap.*.sav" + echo -en "Removing map saves proceduralmap.*.sav file(s)..." + fn_sleep_time + fn_script_log "${currentaction}" + find "${serveridentitydir:?}" -type f -name "proceduralmap.*.sav" -delete + fn_wipe_exit_code + fn_sleep_time + else + fn_print_information_nl "No procedural map save to remove" + fn_script_log_info "No procedural map save to remove." + fi + # Wipe Barren map. + if [ -n "$(find "${serveridentitydir}" -type f -name "barren*.map")" ]; then + currentaction="Removing map file(s): ${serveridentitydir}/barren*.map" + echo -en "Removing barren map barren*.map file(s)..." + fn_sleep_time + fn_script_log "${currentaction}" + find "${serveridentitydir:?}" -type f -name "barren*.map" -delete + fn_wipe_exit_code + fn_sleep_time + else + fn_print_information_nl "No barren map file to remove" + fn_script_log_info "No barren map file to remove." + fi + # Wipe barren map save. + if [ -n "$(find "${serveridentitydir}" -type f -name "barren*.sav")" ]; then + currentaction="Removing barren map save(s): ${serveridentitydir}/barren*.sav" + echo -en "Removing barren map saves barren*.sav file(s)..." + fn_sleep_time + fn_script_log "${currentaction}" + find "${serveridentitydir:?}" -type f -name "barren*.sav" -delete + fn_wipe_exit_code + fn_sleep_time + else + fn_print_information_nl "No barren map save to remove" + fn_script_log_info "No barren map save to remove." + fi + # Wipe user dir, might be a legacy thing, maybe to be removed. + if [ -d "${serveridentitydir}/user" ]; then + currentaction="Removing user directory: ${serveridentitydir}/user" + echo -en "Removing user directory..." + fn_sleep_time + fn_script_log "${currentaction}" + rm -rf "${serveridentitydir:?}/user" + fn_wipe_exit_code + fn_sleep_time + # We do not print additional information if there is nothing to remove since this might be obsolete. + fi + # Wipe storage dir, might be a legacy thing, maybe to be removed. + if [ -d "${serveridentitydir}/storage" ]; then + currentaction="Removing storage directory: ${serveridentitydir}/storage" + echo -en "Removing storage directory..." + fn_sleep_time + fn_script_log "${currentaction}" + rm -rf "${serveridentitydir:?}/storage" + fn_wipe_exit_code + fn_sleep_time + # We do not print additional information if there is nothing to remove since this might be obsolete. + fi + # Wipe sv.files. + if [ -n "$(find "${serveridentitydir}" -type f -name "sv.files.*.db")" ]; then + currentaction="Removing server misc files: ${serveridentitydir}/sv.files.*.db" + echo -en "Removing server misc srv.files*.db file(s)..." + fn_sleep_time + fn_script_log "${currentaction}" + find "${serveridentitydir:?}" -type f -name "sv.files.*.d" -delete + fn_wipe_exit_code + fn_sleep_time + # No further information if not found because it should I could not get this file showing up. + fi + # Wipe player death files. + if [ -n "$(find "${serveridentitydir}" -type f -name "player.deaths.*.db")" ]; then + currentaction="Removing player death files: ${serveridentitydir}/player.deaths.*.db" + echo -en "Removing player deaths player.deaths.*.db file(s)..." + fn_sleep_time + fn_script_log "${currentaction}" + find "${serveridentitydir:?}" -type f -name "player.deaths.*.db" -delete + fn_wipe_exit_code + fn_sleep_time + else + fn_print_information_nl "No player death to remove" + fn_script_log_info "No player death to remove." + fi + # Wipe blueprints only if wipeall command was used. + if [ "${wipeall}" == "1" ]; then + if [ -n "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]; then + currentaction="Removing blueprint file(s): ${serveridentitydir}/player.blueprints.*.db" + echo -en "Removing blueprints player.blueprints.*.db file(s)..." + fn_sleep_time + fn_script_log "${currentaction}" + find "${serveridentitydir:?}" -type f -name "player.blueprints.*.db" -delete + fn_wipe_exit_code + fn_sleep_time + else + fn_print_information_nl "No blueprint file to remove" + fn_script_log_info "No blueprint file to remove." + fi + elif [ -n "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]; then + fn_print_information_nl "Keeping blueprints" + fn_script_log_info "Keeping blueprints." + else + fn_print_information_nl "No blueprints found" + fn_script_log_info "No blueprints found." + fn_sleep_time + fi + # Wipe some logs that might be there. + if [ -n "$(find "${serveridentitydir}" -type f -name "Log.*.txt")" ]; then + currentaction="Removing log files: ${serveridentitydir}/Log.*.txt" + echo -en "Removing Log files..." + fn_sleep_time + fn_script_log "${currentaction}" + find "${serveridentitydir:?}" -type f -name "Log.*.txt" -delete + fn_wipe_exit_code + fn_sleep_time + # We do not print additional information if there are no logs to remove. + fi + # You can add an "elif" here to add another game or engine. + fi +} + +# Check if there is something to wipe, prompt the user, and call appropriate functions. +# Rust Wipe. +if [ "${shortname}" == "rust" ]; then + if [ -d "${serveridentitydir}/storage" ]||[ -d "${serveridentitydir}/user" ]||[ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap*.sav")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "barren*.sav")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "Log.*.txt")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "player.deaths.*.db")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "sv.files.*.db")" ]; then + fn_print_warning_nl "Any user, storage, log and map data from ${serveridentitydir} will be erased." + if ! fn_prompt_yn "Continue?" Y; then + echo Exiting; core_exit.sh + fi + fn_script_log_info "User selects to erase any user, storage, log and map data from ${serveridentitydir}" + fn_sleep_time + fn_wipe_server_process + else + fn_print_information_nl "No data to wipe was found" + fn_script_log_info "No data to wipe was found." + core_exit.sh + fi +# You can add an "elif" here to add another game or engine. +else + # Game not listed. + fn_print_information_nl "Wipe is not available for this game" + fn_script_log_info "Wipe is not available for this game." + core_exit.sh +fi + +core_exit.sh diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/functions/compress_unreal2_maps.sh index 67d3621e2..856bc5086 100644 --- a/lgsm/functions/compress_unreal2_maps.sh +++ b/lgsm/functions/compress_unreal2_maps.sh @@ -1,16 +1,14 @@ #!/bin/bash -# LGSM compress_unreal2_maps.sh function +# LinuxGSM compress_unreal2_maps.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Compresses unreal maps. local commandaction="Unreal Map Compressor" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh -clear -echo "${gamename} Map Compressor" -echo "=================================" +fn_print_header echo "Will compress all maps in:" echo "" pwd @@ -19,19 +17,14 @@ echo "Compressed maps saved to:" echo "" echo "${compressedmapsdir}" echo "" -while true; do - read -e -i "y" -p "Start compression [Y/n]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) echo Exiting; return;; - * ) echo "Please answer yes or no.";; - esac -done +if ! fn_prompt_yn "Start compression?" Y; then + echo Exiting; return +fi mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 -rm -rfv "${filesdir}/Maps/"*.ut2.uz2 -cd "${systemdir}" -for map in "${filesdir}/Maps/"*; do +rm -rfv "${serverfiles}/Maps/"*.ut2.uz2 +cd "${systemdir}" || exit +for map in "${serverfiles}/Maps/"*; do ./ucc-bin compress "${map}" --nohomedir done -mv -fv "${filesdir}/Maps/"*.ut2.uz2 "${compressedmapsdir}" -core_exit.sh \ No newline at end of file +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 index 3ef6e140e..0832ae997 100644 --- a/lgsm/functions/compress_ut99_maps.sh +++ b/lgsm/functions/compress_ut99_maps.sh @@ -1,16 +1,14 @@ #!/bin/bash -# LGSM compress_ut99_maps.sh function +# LinuxGSM compress_ut99_maps.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Compresses unreal maps. local commandaction="Unreal Map Compressor" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh -clear -echo "${gamename} Map Compressor" -echo "=================================" +fn_print_header echo "Will compress all maps in:" echo "" pwd @@ -19,19 +17,14 @@ echo "Compressed maps saved to:" echo "" echo "${compressedmapsdir}" echo "" -while true; do - read -e -i "y" -p "Start compression [Y/n]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) echo Exiting; return;; - * ) echo "Please answer yes or no.";; - esac -done +if ! fn_prompt_yn "Start compression?" Y; then + echo Exiting; return +fi mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 -rm -rfv "${filesdir}/Maps/"*.unr.uz -cd "${systemdir}" -for map in "${filesdir}/Maps/"*; do +rm -rfv "${serverfiles}/Maps/"*.unr.uz +cd "${systemdir}" || exit +for map in "${serverfiles}/Maps/"*; do ./ucc-bin compress "${map}" --nohomedir done -mv -fv "${filesdir}/Maps/"*.unr.uz "${compressedmapsdir}" -core_exit.sh \ No newline at end of file +mv -fv "${serverfiles}/Maps/"*.unr.uz "${compressedmapsdir}" +core_exit.sh diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 6d971b997..910e1dec8 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -1,225 +1,263 @@ #!/bin/bash -# LGSM core_dl.sh function +# LinuxGSM core_dl.sh function # Author: Daniel Gibbs # Contributor: UltimateByte -# Website: https://gameservermanagers.com -# Description: Deals with all downloads for LGSM. - -# fileurl: The URL of the file: http://example.com/dl/File.tar.bz2 -# filedir: location the file is to be saved: /home/server/lgsm/tmp -# filename: name of file (this can be different from the url name): file.tar.bz2 -# executecmd: Optional, set to "executecmd" to make file executable using chmod +x -# run: Optional, set to run to execute the file -# force: Optional, force re-download of file even if exists -# md5: Optional, Checks file against an md5 sum +# 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 "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}" -# fn_fetch_file "http://example.com/file.tar.bz2" "/some/dir" "file.tar.bz2" "executecmd" "run" "force" "10cd7353aa9d758a075c600a6dd193fd" +# 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" local commandname="DOWNLOAD" local commandaction="Download" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Emptys contents of the LinuxGSM tmpdir. +fn_clear_tmp(){ + echo -en "clearing LinuxGSM tmp directory..." + if [ -d "${tmpdir}" ]; then + rm -rf "${tmpdir:?}/"* + local exitcode=$? + if [ ${exitcode} -eq 0 ]; then + fn_print_ok_eol_nl + fn_script_log_pass "clearing LinuxGSM tmp directory" + else + fn_print_error_eol_nl + fn_script_log_error "clearing LinuxGSM tmp directory" + fi + fi +} fn_dl_md5(){ - # Runs MD5 Check if available + # Runs MD5 Check if available. if [ "${md5}" != "0" ]&&[ "${md5}" != "nomd5" ]; then - echo -ne "verifying ${filename} with MD5..." - sleep 1 - local md5sumcmd=$(md5sum "${filedir}/${filename}"|awk '{print $1;}') + echo -en "verifying ${local_filename} with MD5..." + fn_sleep_time + local md5sumcmd=$(md5sum "${local_filedir}/${local_filename}"|awk '{print $1;}') if [ "${md5sumcmd}" != "${md5}" ]; then fn_print_fail_eol_nl - echo "${filename} returned MD5 checksum: ${md5sumcmd}" + echo "${local_filename} returned MD5 checksum: ${md5sumcmd}" echo "expected MD5 checksum: ${md5}" - fn_script_log_fatal "Verifying ${filename} with MD5: FAIL" - fn_script_log_info "${filename} returned MD5 checksum: ${md5sumcmd}" + 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 ${filename} with MD5: OK" - fn_script_log_info "${filename} returned MD5 checksum: ${md5sumcmd}" + 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 or gzip or zip files +# Extracts bzip2, gzip or zip files. # Extracts can be defined in code like so: -# fn_dl_extract "${filedir}" "${filename}" "${extractdir}" +# fn_dl_extract "${local_filedir}" "${local_filename}" "${extractdir}" # fn_dl_extract "/home/gameserver/lgsm/tmp" "file.tar.bz2" "/home/gamserver/serverfiles" fn_dl_extract(){ - filedir="${1}" - filename="${2}" + local_filedir="${1}" + local_filename="${2}" extractdir="${3}" - # extracts archives - echo -ne "extracting ${filename}..." - fn_script_log_info "Extracting download" - mime=$(file -b --mime-type "${filedir}/${filename}") - + # 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 - tarcmd=$(tar -zxf "${filedir}/${filename}" -C "${extractdir}") + extractcmd=$(tar -zxf "${local_filedir}/${local_filename}" -C "${extractdir}") elif [ "${mime}" == "application/x-bzip2" ]; then - tarcmd=$(tar -jxf "${filedir}/${filename}" -C "${extractdir}") + tarcmd=$(tar -jxf "${local_filedir}/${local_filename}" -C "${extractdir}") + elif [ "${mime}" == "application/x-xz" ]; then + tarcmd=$(tar -xf "${local_filedir}/${local_filename}" -C "${extractdir}") elif [ "${mime}" == "application/zip" ]; then - tarcmd=$(unzip -d "${extractdir}" "${filedir}/${filename}") + extractcmd=$(unzip -d "${extractdir}" "${local_filedir}/${local_filename}") fi local exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Extracting download: FAIL" - echo "${tarcmd}" | tee -a "${scriptlog}" + fn_script_log_fatal "Extracting download" + if [ -f "${lgsmlog}" ]; then + echo "${extractcmd}" >> "${lgsmlog}" + fi + echo "${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 +# Trap to remove file download if canceled before completed. fn_fetch_trap(){ echo "" - echo -ne "downloading ${filename}..." + echo -en "downloading ${local_filename}..." fn_print_canceled_eol_nl - fn_script_log_info "downloading ${filename}...CANCELED" - sleep 1 - rm -f "${filedir}/${filename}" | tee -a "${scriptlog}" - echo -ne "downloading ${filename}..." + 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 ${filename}...REMOVED" + fn_script_log_info "Downloading ${local_filename}...REMOVED" core_exit.sh } fn_fetch_file(){ - fileurl="${1}" - filedir="${2}" - filename="${3}" - executecmd="${4:-0}" + remote_fileurl="${1}" + local_filedir="${2}" + local_filename="${3}" + chmodx="${4:-0}" run="${5:-0}" - force="${6:-0}" + forcedl="${6:-0}" md5="${7:-0}" - # If the file is missing, then download - if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" + # Download file if missing or download forced. + if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + if [ ! -d "${local_filedir}" ]; then + mkdir -p "${local_filedir}" fi - - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - # trap to remove part downloaded files - trap fn_fetch_trap INT - # if larger file shows progress bar - if [ ${filename##*.} == "bz2" ]||[ ${filename##*.} == "jar" ]; then - echo -ne "downloading ${filename}..." - sleep 1 - curlcmd=$(${curlcmd} --progress-bar --fail -L -o "${filedir}/${filename}" "${fileurl}") - echo -ne "downloading ${filename}..." - else - echo -ne " fetching ${filename}...\c" - curlcmd=$(${curlcmd} -s --fail -L -o "${filedir}/${filename}" "${fileurl}" 2>&1) - fi - local exitcode=$? - if [ ${exitcode} -ne 0 ]; then - fn_print_fail_eol_nl - if [ -f "${scriptlog}" ]; then - fn_script_log_fatal "downloading ${filename}: FAIL" - fi - echo -e "${fileurl}" | tee -a "${scriptlog}" - echo "${curlcmd}" | tee -a "${scriptlog}" - core_exit.sh - else - fn_print_ok_eol_nl - if [ -f "${scriptlog}" ]; then - fn_script_log_pass "downloading ${filename}: OK" - fi - fi - # remove trap - trap - INT + # 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=$(${curlpath} --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}") + echo -en "downloading ${local_filename}..." else + echo -en " fetching ${local_filename}...\c" + curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1) + fi + local exitcode=$? + if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl - echo "Curl is not installed!" - echo -e "" - if [ -f "${scriptlog}" ]; then - fn_script_log_fatal "Curl is not installed!" + if [ -f "${lgsmlog}" ]; then + fn_script_log_fatal "Downloading ${local_filename}" + echo -e "${remote_fileurl}" >> "${lgsmlog}" + echo "${curlcmd}" >> "${lgsmlog}" fi + echo -e "${remote_fileurl}" + echo "${curlcmd}" core_exit.sh + else + fn_print_ok_eol_nl + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Downloading ${local_filename}" + fi fi - # make file executecmd if executecmd is set - if [ "${executecmd}" == "executecmd" ]; then - chmod +x "${filedir}/${filename}" + # Remove trap. + trap - INT + # Make file executable if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" fi fi - if [ -f "${filedir}/${filename}" ]; then + if [ -f "${local_filedir}/${local_filename}" ]; then fn_dl_md5 - # run file if run is set + # Execute file if run is set. if [ "${run}" == "run" ]; then - source "${filedir}/${filename}" + 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 -# fileurl: The directory the file is located in teh GitHub repo -# filedir: name of file -# filename: location file to be saved -# executecmd: set to "executecmd" to make file executecmd -# run: Optional, set to run to execute the file -# force: force download of file even if exists -# md5: Checks fail against an md5 sum +# 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 github repo +# Fetches any files from the GitHub repo. fn_fetch_file_github(){ github_file_url_dir="${1}" github_file_url_name="${2}" githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" - fileurl="${githuburl}" - filedir="${3}" - filename="${github_file_url_name}" - executecmd="${4:-0}" + + remote_fileurl="${githuburl}" + local_filedir="${3}" + local_filename="${github_file_url_name}" + chmodx="${4:-0}" run="${5:-0}" - force="${6:-0}" + forcedl="${6:-0}" md5="${7:-0}" - fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}" + # Passes vars to the file download function. + fn_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } +fn_fetch_config(){ + github_file_url_dir="${1}" + github_file_url_name="${2}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# Fetches functions + remote_fileurl="${githuburl}" + 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}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" +} + +# Fetches functions. fn_fetch_function(){ - github_file_url_dir="lgsm/functions" # github dir containing the file - github_file_url_name="${functionfile}" # name of the github file + github_file_url_dir="lgsm/functions" + github_file_url_name="${functionfile}" githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" - fileurl="${githuburl}" - filedir="${functionsdir}" - filename="${github_file_url_name}" - executecmd="executecmd" + + remote_fileurl="${githuburl}" + local_filedir="${functionsdir}" + local_filename="${github_file_url_name}" + chmodx="chmodx" run="run" - force="noforce" + forcedl="noforce" md5="nomd5" - fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}" + # Passes vars to the file download function. + fn_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } fn_update_function(){ exitbypass=1 - github_file_url_dir="lgsm/functions" # github dir containing the file - github_file_url_name="${functionfile}" # name of the github file + github_file_url_dir="lgsm/functions" + github_file_url_name="${functionfile}" githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" - fileurl="${githuburl}" - filedir="${functionsdir}" - filename="${github_file_url_name}" - executecmd="executecmd" + + remote_fileurl="${githuburl}" + local_filedir="${functionsdir}" + local_filename="${github_file_url_name}" + chmodx="chmodx" run="norun" - force="noforce" + forcedl="noforce" md5="nomd5" - fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}" + fn_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } + +# Defines curl path. +curlpath=$(command -v curl 2>/dev/null) + +if [ "$(basename "${curlpath}")" != "curl" ]; then + echo "[ FAIL ] Curl is not installed" + exit 1 +fi \ No newline at end of file diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh index d5f17dfe5..f92d3b129 100644 --- a/lgsm/functions/core_exit.sh +++ b/lgsm/functions/core_exit.sh @@ -1,16 +1,25 @@ #!/bin/bash -# LGSM core_exit.sh function +# LinuxGSM core_exit.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com -# Description: Handles exiting of LGSM by running and reporting an exit code. +# Website: https://linuxgsm.com +# Description: Handles exiting of LinuxGSM by running and reporting an exit code. fn_exit_dev_debug(){ if [ -f "${rootdir}/.dev-debug" ]; then echo "" echo "${function_selfname} exiting with code: ${exitcode}" + if [ -f "${rootdir}/dev-debug.log" ]; then + grep "functionfile=" "${rootdir}/dev-debug.log" | sed 's/functionfile=//g' > "${rootdir}/dev-debug-function-order.log" + fi 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 [ -n "${exitbypass}" ]; then unset exitbypass elif [ -n "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then @@ -26,12 +35,11 @@ elif [ -n "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then fn_exit_dev_debug # remove trap. trap - INT - exit ${exitcode} + exit "${exitcode}" else - exitcode=0 fn_script_log_pass "${function_selfname} exiting with code: ${exitcode}" fn_exit_dev_debug # remove trap. trap - INT - exit ${exitcode} + exit "${exitcode}" fi diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 34e20ead0..5f8256656 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -1,123 +1,61 @@ #!/bin/bash -# LGSM core_functions.sh function +# LinuxGSM core_functions.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# 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. -# Fixes for legacy code -if [ "${gamename}" == "Teamspeak 3" ]; then - gamename="TeamSpeak 3" -elif [ "${gamename}" == "Counter Strike: Global Offensive" ]; then - gamename="Counter-Strike: Global Offensive" -elif [ "${gamename}" == "Counter Strike: Source" ]; then - gamename="Counter-Strike: Source" -elif [ "${gamename}" == "Quake Live" ]; then - engine="idtech3_ql" -fi - -if [ "${emailnotification}" == "on" ]; then - emailalert="on" -fi +# Core -## Code/functions for legacy servers -fn_functions(){ +core_dl.sh(){ functionfile="${FUNCNAME}" -fn_fetch_function +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 } -fn_getopt(){ +core_messages.sh(){ functionfile="${FUNCNAME}" -fn_fetch_function -} - -## In case older versions are missing these vars -if [ -z "${lgsmdir}" ]||[ -z "${functionsdir}" ]||[ -z "${libdir}" ]||[ -z "${tmpdir}" ]; then - lgsmdir="${rootdir}/lgsm" - functionsdir="${lgsmdir}/functions" - libdir="${lgsmdir}/lib" - tmpdir="${lgsmdir}/tmp" -fi - -## fn_fetch_core_dl placed here to allow legacy servers to still download core functions -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "${red}FAIL${default}\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "${green}OK${default}" - fi - else - echo -e "${red}FAIL${default}\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" +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 -source "${filedir}/${filename}" } -# Creates tmp dir if missing -if [ ! -d "${tmpdir}" ]; then - mkdir -p "${tmpdir}" -fi - -# Core - -core_dl.sh(){ -# Functions are defined in core_functions.sh. +core_legacy.sh(){ functionfile="${FUNCNAME}" -fn_fetch_core_dl +if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then + fn_fetch_core_dl "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +else + fn_bootstrap_fetch_file_github "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +fi } core_exit.sh(){ functionfile="${FUNCNAME}" -fn_fetch_core_dl +fn_fetch_function } core_getopt.sh(){ functionfile="${FUNCNAME}" -fn_fetch_core_dl +fn_fetch_function } core_trap.sh(){ functionfile="${FUNCNAME}" -fn_fetch_core_dl +fn_fetch_function } -core_messages.sh(){ +# Commands + +command_backup.sh(){ functionfile="${FUNCNAME}" -fn_fetch_core_dl +fn_fetch_function } - -# Commands - command_console.sh(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -128,29 +66,22 @@ functionfile="${FUNCNAME}" fn_fetch_function } -command_postdetails.sh(){ - functionfile="${FUNCNAME}" - tempffname="${functionfile}" - # First, grab the command_postdetails.sh file - fn_fetch_function - # But then next, command_details.sh needs to also be pulled - # because command_postdetails.sh sources its functions -CedarLUG - functionfile="command_details.sh" - fn_fetch_function - functionfile="${tempffname}" +command_details.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function } -command_details.sh(){ +command_donate.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } -command_test_alert.sh(){ +command_postdetails.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } -command_backup.sh(){ +command_test_alert.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } @@ -180,6 +111,31 @@ functionfile="${FUNCNAME}" fn_fetch_function } +command_install_resources_mta.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +install_squad_license.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +command_mods_install.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +command_mods_update.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +command_mods_remove.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + command_fastdl.sh(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -195,6 +151,10 @@ functionfile="${FUNCNAME}" fn_fetch_function } +command_wipe.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} # Checks @@ -213,6 +173,11 @@ functionfile="${FUNCNAME}" fn_fetch_function } +check_executable.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + check_glibc.sh(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -263,7 +228,6 @@ functionfile="${FUNCNAME}" fn_fetch_function } - # Compress compress_unreal2_maps.sh(){ @@ -276,9 +240,25 @@ functionfile="${FUNCNAME}" fn_fetch_function } +# Mods + +mods_list.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +mods_core.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} # Dev +command_dev_clear_functions.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + command_dev_debug.sh(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -299,6 +279,10 @@ functionfile="${FUNCNAME}" fn_fetch_function } +command_dev_query_raw.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} # Fix @@ -307,6 +291,11 @@ functionfile="${FUNCNAME}" fn_fetch_function } +fix_ark.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + fix_arma3.sh(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -332,12 +321,17 @@ functionfile="${FUNCNAME}" fn_fetch_function } -fix_steamcmd.sh(){ +fix_kf.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } -fix_glibc.sh(){ +fix_kf2.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +fix_mta.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } @@ -353,7 +347,57 @@ functionfile="${FUNCNAME}" fn_fetch_function } -fix_kf.sh(){ +fix_rust.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +fix_rw.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +fix_steamcmd.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +fix_terraria.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +fix_tf2.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +fix_ut3.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +fix_rust.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +fix_sdtd.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +fix_sof2.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +fix_ss3.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +fix_ts3.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } @@ -368,7 +412,12 @@ functionfile="${FUNCNAME}" fn_fetch_function } -fix_rust.sh(){ +fix_unt.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +fix_wurm.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } @@ -385,16 +434,20 @@ functionfile="${FUNCNAME}" fn_fetch_function } -info_glibc.sh(){ +info_gamedig.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } -info_parms.sh(){ +info_messages.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } +info_parms.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} # Alert @@ -403,16 +456,41 @@ functionfile="${FUNCNAME}" fn_fetch_function } +alert_discord.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + alert_email.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } +alert_ifttt.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +alert_mailgun.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + alert_pushbullet.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } +alert_pushover.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +alert_telegram.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + # Logs logs.sh(){ @@ -420,15 +498,13 @@ functionfile="${FUNCNAME}" fn_fetch_function } +# Query -# Monitor - -monitor_gsquery.sh(){ +query_gamedig.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } - # Update command_update_functions.sh(){ @@ -436,6 +512,11 @@ functionfile="${FUNCNAME}" fn_fetch_function } +command_update_linuxgsm.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + command_update.sh(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -456,6 +537,16 @@ functionfile="${FUNCNAME}" fn_fetch_function } +update_mta.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + +update_factorio.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + update_steamcmd.sh(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -466,7 +557,6 @@ functionfile="${FUNCNAME}" fn_fetch_function } - # ## Installer functions # @@ -486,32 +576,37 @@ functionfile="${FUNCNAME}" fn_fetch_function } +install_factorio_save.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + install_dst_token.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } -install_gsquery.sh(){ +install_eula.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } -install_gslt.sh(){ +install_gsquery.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } -install_header.sh(){ +install_gslt.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } -install_logs.sh(){ +install_header.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } -install_minecraft_eula.sh(){ +install_logs.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } @@ -560,11 +655,19 @@ functionfile="${FUNCNAME}" fn_fetch_function } -# Calls the global Ctrl-C trap -core_trap.sh +# Calls code required for legacy servers +core_legacy.sh + +# Creates tmp dir if missing +if [ ! -d "${tmpdir}" ]; then + mkdir -p "${tmpdir}" +fi -# Calls on-screen messages +# Calls on-screen messages (bootstrap) core_messages.sh -#Calls file downloader +#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 index 5a5622be3..dbd240bbb 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -1,723 +1,202 @@ #!/bin/bash -# LGSM core_getopt.sh function +# LinuxGSM core_getopt.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: getopt arguments. -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_getopt_generic(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - fu|force-update|update-restart) - forceupdate=1; - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - v|validate) - command_validate.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD." - echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - } | column -s $'\t' -t - esac -} +### 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 hastebin (removing passwords)." ) +cmd_backup=( "b;backup" "command_backup.sh" "Create backup archives of the server." ) +cmd_update_linuxgsm=( "ul;update-lgsm;uf;update-functions" "command_update_linuxgsm.sh" "Check and apply any LinuxGSM updates." ) +cmd_test_alert=( "ta;test-alert" "command_test_alert.sh" "Send a test alert." ) +cmd_monitor=( "m;monitor" "command_monitor.sh" "Check server status and restart if crashed." ) +cmd_donate=( "do;donate" "command_donate.sh" "Donation options." ) +# Console servers only. +cmd_console=( "c;console" "command_console.sh" "Access server console." ) +cmd_debug=( "d;debug" "command_debug.sh" "Start server directly in your terminal." ) +# Update servers only. +cmd_update=( "u;update" "command_update.sh" "Check and apply any server updates." ) +cmd_force_update=( "fu;force-update;update-restart;ur" "forceupdate=1; command_update.sh" "Apply server updates bypassing check." ) +# SteamCMD servers only. +cmd_validate=( "v;validate" "command_validate.sh" "Validate server files with SteamCMD." ) +# Server with mods-install. +cmd_mods_install=( "mi;mods-install" "command_mods_install.sh" "View and install available mods/addons." ) +cmd_mods_remove=( "mr;mods-remove" "command_mods_remove.sh" "View and remove an installed mod/addon." ) +cmd_mods_update=( "mu;mods-update" "command_mods_update.sh" "Update installed mods/addons." ) +# Server specific. +cmd_change_password=( "pw;change-password" "command_ts3_server_pass.sh" "Change TS3 serveradmin password." ) +cmd_install_default_resources=( "ir;install-default-resources" "command_install_resources_mta.sh" "Install the MTA default resources." ) +cmd_wipe=( "wi;wipe" "command_wipe.sh" "Wipe your main game server data." ) +cmd_wipeall=( "wa;wipeall" "wipeall=1; command_wipe.sh" "Wipe your game server data and blueprints." ) +cmd_map_compressor_u99=( "mc;map-compressor" "compress_ut99_maps.sh" "Compresses all ${gamename} server maps." ) +cmd_map_compressor_u2=( "mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps." ) +cmd_install_cdkey=( "cd;server-cd-key" "install_ut2k4_key.sh" "Add your server cd key." ) +cmd_install_dst_token=( "ct;cluster-token" "install_dst_token.sh" "Configure cluster token." ) +cmd_install_squad_license=( "li;license" "install_squad_license.sh" "Add your Squad server license." ) +cmd_fastdl=( "fd;fastdl" "command_fastdl.sh" "Build a FastDL directory." ) +# Dev commands. +cmd_dev_debug=( "dev;developer" "command_dev_debug.sh" "Enable developer Mode." ) +cmd_dev_detect_deps=( "dd;detect-deps" "command_dev_detect_deps.sh" "Detect required dependencies." ) +cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc." ) +cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies." ) +cmd_dev_query_raw=( "qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery." ) +cmd_dev_clear_functions=( "cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir." ) -fn_getopt_generic_no_update(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - } | column -s $'\t' -t - esac -} +### Set specific opt here. -fn_getopt_teamspeak3(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - pw|change-password) - command_ts3_server_pass.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from teamspeak.com." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}change-password\t${default}pw |Changes TS3 serveradmin password." - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - } | column -s $'\t' -t - esac -} +currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" ) -fn_getopt_minecraft(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from mojang.com." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - } | column -s $'\t' -t - esac -} +# Update LGSM. +currentopt+=( "${cmd_update_linuxgsm[@]}" ) -fn_getopt_mumble(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - dev|dev-debug) - command_dev_debug.sh;; - c|console) - command_console.sh;; - i|install) - command_install.sh;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 +# Exclude noupdate games here. +if [ "${engine}" != "quake" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "idtech3" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]&&[ "${shortname}" != "bf1942" ]&&[ "${shortname}" != "samp" ]; then + currentopt+=( "${cmd_update[@]}" ) + # force update for SteamCMD only or MTA. + if [ -n "${appid}" ]||[ "${shortname}" == "mta" ]; then + currentopt+=( "${cmd_force_update[@]}" ) fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from GitHub." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - } | column -s $'\t' -t - esac -} +fi -fn_getopt_dstserver(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - fu|force-update|update-restart) - forceupdate=1; - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - v|validate) - command_validate.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - ct|cluster-token) - install_dst_token.sh;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD." - echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - echo -e "${blue}cluster-token\t${default}ct |Configure cluster token." - } | column -s $'\t' -t - esac -} +# Validate command. +if [ -n "${appid}" ]; then + currentopt+=( "${cmd_validate[@]}" ) +fi -fn_getopt_gmodserver(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - fu|force-update|update-restart) - forceupdate=1; - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - v|validate) - command_validate.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - fd|fastdl) - command_fastdl.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD." - echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - echo -e "${blue}fastdl\t${default}fd |Generates or update a FastDL directory for your server." - } | column -s $'\t' -t - esac -} +#Backup. +currentopt+=( "${cmd_backup[@]}" ) -fn_getopt_unreal(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - mc|map-compressor) - compress_ut99_maps.sh;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps." - } | column -s $'\t' -t - esac -} +# Exclude games without a console. +if [ "${shortname}" != "ts3" ]; then + currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) +fi +## Game server exclusive commands. -fn_getopt_unreal2(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - fu|force-update|update-restart) - forceupdate=1; - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - v|validate) - command_validate.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - mc|map-compressor) - compress_unreal2_maps.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}Checks and applies updates from SteamCMD." - echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps." - } | column -s $'\t' -t - esac -} +# FastDL command. +if [ "${engine}" == "source" ]; then + currentopt+=( "${cmd_fastdl[@]}" ) +fi +# TeamSpeak exclusive. +if [ "${shortname}" == "ts3" ]; then + currentopt+=( "${cmd_change_password[@]}" ) +fi -fn_getopt_ut2k4(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - cd|server-cd-key) - install_ut2k4_key.sh;; - mc|map-compressor) - compress_unreal2_maps.sh;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 +# Unreal exclusive. +if [ "${shortname}" == "rust" ]; then + currentopt+=( "${cmd_wipe[@]}" "${cmd_wipeall[@]}" ) +fi +if [ "${engine}" == "unreal2" ]; then + if [ "${shortname}" == "ut2k4" ]; then + currentopt+=( "${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}" ) + else + currentopt+=( "${cmd_map_compressor_u2[@]}" ) fi +fi +if [ "${engine}" == "unreal" ]; then + currentopt+=( "${cmd_map_compressor_u99[@]}" ) +fi + +# DST exclusive. +if [ "${shortname}" == "dst" ]; then + currentopt+=( "${cmd_install_dst_token[@]}" ) +fi + +# MTA exclusive. +if [ "${shortname}" == "mta" ]; then + currentopt+=( "${cmd_install_default_resources[@]}" ) +fi + +# Squad license exclusive. +if [ "${shortname}" == "squad" ]; then + currentopt+=( "${cmd_install_squad_license[@]}" ) +fi + +## Mods commands. +if [ "${engine}" == "source" ]||[ "${shortname}" == "rust" ]||[ "${shortname}" == "hq" ]||[ "${shortname}" == "sdtd" ]; then + currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" ) +fi + +## Installer. +currentopt+=( "${cmd_install[@]}" "${cmd_auto_install[@]}" ) + +## Developer commands. +currentopt+=( "${cmd_dev_debug[@]}" ) +if [ -f ".dev-debug" ]; then + currentopt+=( "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_functions[@]}" ) +fi + +## Donate. +currentopt+=( "${cmd_donate[@]}" ) + +### Build list of available commands. +optcommands=() +index="0" +for ((index="0"; index < ${#currentopt[@]}; index+=3)); do + cmdamount="$(echo "${currentopt[index]}" | awk -F ';' '{ print NF }')" + for ((cmdindex=1; cmdindex <= ${cmdamount}; cmdindex++)); do + optcommands+=( "$(echo "${currentopt[index]}" | awk -F ';' -v x=${cmdindex} '{ print $x }')" ) + done +done + +# Shows LinuxGSM usage. +fn_opt_usage(){ echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" + echo -e "" + echo "LinuxGSM - ${gamename} - Version ${version}" + echo "https://linuxgsm.com/${gameservername}" echo -e "" echo -e "${lightyellow}Commands${default}" + # Display available commands. + index="0" { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - echo -e "${blue}server-cd-key\t${default}cd |Add your server cd key" - echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps." + for ((index="0"; index < ${#currentopt[@]}; index+=3)); do + # Hide developer commands. + if [ "${currentopt[index+2]}" != "DEVCOMMAND" ]; then + echo -e "${cyan}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index+2]}" + fi + done } | column -s $'\t' -t - esac + core_exit.sh } -if [ "${gamename}" == "Mumble" ]; then - fn_getopt_mumble -elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]||[ "${gamename}" == "Call of Duty 2" ]||[ "${gamename}" == "Call of Duty: World at War" ]||[ "${gamename}" == "QuakeWorld" ]||[ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]||[ "${gamename}" == "Jedi Knight II: Jedi Outcast" ]||[ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then - fn_getopt_generic_no_update -elif [ "${engine}" == "lwjgl2" ]; then - fn_getopt_minecraft -elif [ "${gamename}" == "TeamSpeak 3" ]; then - fn_getopt_teamspeak3 -elif [ "${gamename}" == "Don't Starve Together" ]; then - fn_getopt_dstserver -elif [ "${gamename}" == "Garry's Mod" ]; then - fn_getopt_gmodserver -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 -else - fn_getopt_generic +# Check if user commands exist and run corresponding scripts, or display script usage. +if [ -z "${getopt}" ]; then + fn_opt_usage fi +# 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 "${currentopt[index]}" | awk -F ';' '{ print NF }')" + for ((currcmdindex=1; currcmdindex <= ${currcmdamount}; currcmdindex++)); do + if [ "$(echo "${currentopt[index]}" | awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then + # Run command. + eval "${currentopt[index+1]}" + core_exit.sh + break + fi + done + done + fi +done + +# If we're executing this, it means command was not found. +echo -e "${red}Unknown command${default}: $0 ${getopt}" +exitcode=2 +fn_opt_usage core_exit.sh diff --git a/lgsm/functions/core_legacy.sh b/lgsm/functions/core_legacy.sh new file mode 100644 index 000000000..1b525b669 --- /dev/null +++ b/lgsm/functions/core_legacy.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# LinuxGSM core_legacy.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Code for backwards compatability with older versions of LinuxGSM. + +if [ -z "${serverfiles}" ]; then + legacymode=1 + 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="${rootdir}/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 + +# Alternations to workshop variables. +if [ -z "${wsapikey}" ]; then + if [ "${workshopauth}" ]; then + wsapikey="${workshopauth}" + elif [ "${authkey}" ]; then + wsapikey="${authkey}" + fi +fi + +if [ -z "${wscollectionid}" ]; then + if [ "${workshopauth}" ]; then + wscollectionid="${ws_collection_id}" + elif [ "${authkey}" ]; then + wscollectionid="${workshopcollectionid}" + fi +fi + +if [ -z "${wsstartmap}" ]; then + if [ "${ws_start_map}" ]; then + wscollectionid="${ws_start_map}" + fi +fi diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 540729af7..51b9a4817 100644 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -1,47 +1,62 @@ #!/bin/bash -# LGSM core_messages.sh function +# LinuxGSM core_messages.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Contributor: s-eam +# Website: https://linuxgsm.com # Description: Defines on-screen messages such as [ OK ] and how script logs look. -# nl: new line: message is following by a new line -# eol: end of line: message is placed at the end of the current line - -if [ "${ansi}" != "off" ]; then - # echo colors - default="\e[0m" - red="\e[31m" - green="\e[32m" - yellow="\e[33m" - lightyellow="\e[93m" - blue="\e[34m" - lightblue="\e[94m" - magenta="\e[35m" - cyan="\e[36m" - # carriage return & erase to end of line +# nl: new line: message is following by a new line. +# eol: end of line: message is placed at the end of the current line. +fn_ansi_loader(){ + if [ "${ansi}" != "off" ]; then + # echo colors + default="\e[0m" + 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" + fi + # carriage return & erase to end of line. creeol="\r\033[K" -fi +} + +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 "${scriptlogdir}" ]; then + if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: ${1}" >> "${scriptlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${servicename}: ${commandname}: ${1}" >> "${lgsmlog}" else - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${servicename}: ${1}" >> "${lgsmlog}" fi fi } ## Feb 28 14:56:58 ut99-server: Monitor: PASS: fn_script_log_pass(){ - if [ -d "${scriptlogdir}" ]; then + if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: PASS: ${1}" >> "${scriptlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${servicename}: ${commandname}: PASS: ${1}" >> "${lgsmlog}" else - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: PASS: ${1}" >> "${scriptlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${servicename}: PASS: ${1}" >> "${lgsmlog}" fi fi exitcode=0 @@ -49,11 +64,11 @@ fn_script_log_pass(){ ## Feb 28 14:56:58 ut99-server: Monitor: FATAL: fn_script_log_fatal(){ - if [ -d "${scriptlogdir}" ]; then + if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: FATAL: ${1}" >> "${scriptlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${servicename}: ${commandname}: FATAL: ${1}" >> "${lgsmlog}" else - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: FATAL: ${1}" >> "${scriptlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${servicename}: FATAL: ${1}" >> "${lgsmlog}" fi fi exitcode=1 @@ -61,11 +76,11 @@ fn_script_log_fatal(){ ## Feb 28 14:56:58 ut99-server: Monitor: ERROR: fn_script_log_error(){ - if [ -d "${scriptlogdir}" ]; then + if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: ERROR: ${1}" >> "${scriptlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${servicename}: ${commandname}: ERROR: ${1}" >> "${lgsmlog}" else - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ERROR: ${1}" >> "${scriptlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${servicename}: ERROR: ${1}" >> "${lgsmlog}" fi fi exitcode=2 @@ -73,11 +88,11 @@ fn_script_log_error(){ ## Feb 28 14:56:58 ut99-server: Monitor: WARN: fn_script_log_warn(){ - if [ -d "${scriptlogdir}" ]; then + if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: WARN: ${1}" >> "${scriptlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${servicename}: ${commandname}: WARN: ${1}" >> "${lgsmlog}" else - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: WARN: ${1}" >> "${scriptlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${servicename}: WARN: ${1}" >> "${lgsmlog}" fi fi exitcode=3 @@ -85,11 +100,11 @@ fn_script_log_warn(){ ## Feb 28 14:56:58 ut99-server: Monitor: INFO: fn_script_log_info(){ - if [ -d "${scriptlogdir}" ]; then + if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: INFO: ${1}" >> "${scriptlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${servicename}: ${commandname}: INFO: ${1}" >> "${lgsmlog}" else - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: INFO: ${1}" >> "${scriptlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${servicename}: INFO: ${1}" >> "${lgsmlog}" fi fi } @@ -104,6 +119,7 @@ fn_print_dots(){ else echo -en "${creeol}[ .... ] $@" fi + fn_sleep_time } fn_print_dots_nl(){ @@ -112,7 +128,7 @@ fn_print_dots_nl(){ else echo -e "${creeol}[ .... ] $@" fi - sleep 0.5 + fn_sleep_time echo -en "\n" } @@ -123,6 +139,7 @@ fn_print_ok(){ else echo -en "${creeol}[${green} OK ${default}] $@" fi + fn_sleep_time } fn_print_ok_nl(){ @@ -131,7 +148,7 @@ fn_print_ok_nl(){ else echo -en "${creeol}[${green} OK ${default}] $@" fi - sleep 0.5 + fn_sleep_time echo -en "\n" } @@ -142,6 +159,7 @@ fn_print_fail(){ else echo -en "${creeol}[${red} FAIL ${default}] $@" fi + fn_sleep_time } fn_print_fail_nl(){ @@ -150,7 +168,7 @@ fn_print_fail_nl(){ else echo -en "${creeol}[${red} FAIL ${default}] $@" fi - sleep 0.5 + fn_sleep_time echo -en "\n" } @@ -161,6 +179,7 @@ fn_print_error(){ else echo -en "${creeol}[${red}ERROR ${default}] $@" fi + fn_sleep_time } fn_print_error_nl(){ @@ -169,7 +188,7 @@ fn_print_error_nl(){ else echo -en "${creeol}[${red}ERROR ${default}] $@" fi - sleep 0.5 + fn_sleep_time echo -en "\n" } @@ -180,6 +199,7 @@ fn_print_warn(){ else echo -en "${creeol}[${yellow} WARN ${default}] $@" fi + fn_sleep_time } fn_print_warn_nl(){ @@ -188,7 +208,7 @@ fn_print_warn_nl(){ else echo -en "${creeol}[${yellow} WARN ${default}] $@" fi - sleep 0.5 + fn_sleep_time echo -en "\n" } @@ -199,6 +219,7 @@ fn_print_info(){ else echo -en "${creeol}[${cyan} INFO ${default}] $@" fi + fn_sleep_time } fn_print_info_nl(){ @@ -207,7 +228,7 @@ fn_print_info_nl(){ else echo -en "${creeol}[${cyan} INFO ${default}] $@" fi - sleep 0.5 + fn_sleep_time echo -en "\n" } @@ -226,46 +247,79 @@ fn_print_header(){ # Complete! fn_print_complete(){ echo -en "${green}Complete!${default} $@" + fn_sleep_time } fn_print_complete_nl(){ echo -e "${green}Complete!${default} $@" + fn_sleep_time } # Failure! fn_print_failure(){ echo -en "${red}Failure!${default} $@" + fn_sleep_time } fn_print_failure_nl(){ echo -e "${red}Failure!${default} $@" + fn_sleep_time } # Error! fn_print_error2(){ echo -en "${red}Error!${default} $@" + fn_sleep_time } fn_print_error2_nl(){ echo -e "${red}Error!${default} $@" + fn_sleep_time } # Warning! fn_print_warning(){ echo -en "${yellow}Warning!${default} $@" + fn_sleep_time } fn_print_warning_nl(){ echo -e "${yellow}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 "Please answer yes or no." ;; + esac + done } # On-Screen End of Line @@ -289,22 +343,27 @@ fn_print_fail_eol_nl(){ echo -e "${red}FAIL${default}" } +# ERROR +fn_print_error_eol(){ + echo -en "${red}ERROR${default}" +} + # WARN fn_print_warn_eol(){ - echo -en "${red}FAIL${default}" + echo -en "${red}WARN${default}" } fn_print_warn_eol_nl(){ - echo -e "${red}FAIL${default}" + echo -e "${red}WARN${default}" } # INFO fn_print_info_eol(){ - echo -en "${red}FAIL${default}" + echo -en "${red}INFO${default}" } fn_print_info_eol_nl(){ - echo -e "${red}FAIL${default}" + echo -e "${red}INFO${default}" } # QUERYING @@ -325,6 +384,15 @@ fn_print_checking_eol_nl(){ echo -e "${cyan}CHECKING${default}" } +# DELAY +fn_print_delay_eol(){ + echo -en "${green}DELAY${default}" +} + +fn_print_delay_eol_nl(){ + echo -e "${green}DELAY${default}" +} + # CANCELED fn_print_canceled_eol(){ echo -en "${yellow}CANCELED${default}" diff --git a/lgsm/functions/core_trap.sh b/lgsm/functions/core_trap.sh index 46615cfe5..57bec2aa7 100644 --- a/lgsm/functions/core_trap.sh +++ b/lgsm/functions/core_trap.sh @@ -1,7 +1,7 @@ #!/bin/bash -# LGSM core_trap.sh function +# LinuxGSM core_trap.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Handles CTRL-C trap to give an exit code. fn_exit_trap(){ diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 9957bade0..5234cd290 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -1,82 +1,102 @@ #!/bin/bash -# LGSM fix.sh function +# LinuxGSM fix.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Overall function for managing fixes. # Runs functions that will fix an issue. local commandname="FIX" local commandaction="Fix" -# Messages that are displayed for some fixes +# Messages that are displayed for some fixes. fn_fix_msg_start(){ fn_print_dots "Applying ${fixname} fix: ${gamename}" - sleep 1 fn_print_info "Applying ${fixname} fix: ${gamename}" fn_script_log_info "Applying ${fixname} fix: ${gamename}" - sleep 1 +} + +fn_fix_msg_start_nl(){ + fn_print_dots "Applying ${fixname} fix: ${gamename}" + fn_print_info "Applying ${fixname} fix: ${gamename}" + fn_script_log_info "Applying ${fixname} fix: ${gamename}" } fn_fix_msg_end(){ if [ $? -ne 0 ]; then fn_print_error_nl "Applying ${fixname} fix: ${gamename}" fn_script_log_error "Applying ${fixname} fix: ${gamename}" - exitcode=2 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 [ "${function_selfname}" != "command_install.sh" ]; then +# Fixes that are run on start. +if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; then if [ -n "${appid}" ]; then fix_steamcmd.sh fi - if [ "${gamename}" == "ARMA 3" ]; then + if [ "${shortname}" == "arma3" ]; then fix_arma3.sh - elif [ "${gamename}" == "Counter-Strike: Global Offensive" ]; then + elif [ "${shortname}" == "ark" ]; then + fix_ark.sh + elif [ "${shortname}" == "csgo" ]; then fix_csgo.sh - elif [ "${gamename}" == "Don't Starve Together" ]; then + elif [ "${shortname}" == "dst" ]; then fix_dst.sh - elif [ "${gamename}" == "GoldenEye: Source" ]; then + elif [ "${shortname}" == "ges" ]; then fix_ges.sh elif [ "${gamename}" == "Jedi Knight II: Jedi Outcast" ]; then fix_jk2.sh - elif [ "${gamename}" == "Insurgency" ]; then + elif [ "${shortname}" == "ins" ]; then fix_ins.sh - elif [ "${gamename}" == "Rust" ]; then + elif [ "${shortname}" == "rust" ]; then fix_rust.sh + elif [ "${shortname}" == "rw" ]; then + fix_rw.sh + elif [ "${shortname}" == "sdtd" ]; then + fix_sdtd.sh + elif [ "${shortname}" == "sof2" ]; then + fix_sof2.sh + elif [ "${shortname}" == "ss3" ]; then + fix_ss3.sh + elif [ "${shortname}" == "tf2" ]; then + fix_tf2.sh + elif [ "${shortname}" == "terraria" ]; then + fix_terraria.sh + elif [ "${shortname}" == "ts3" ]; then + fix_ts3.sh + elif [ "${shortname}" == "mta" ]; then + fix_mta.sh + elif [ "${shortname}" == "unt" ]; then + fix_unt.sh + elif [ "${shortname}" == "wurm" ]; then + fix_wurm.sh fi fi # Fixes that are run on install only. if [ "${function_selfname}" == "command_install.sh" ]; then - if [ "${gamename}" == "Killing Floor" ]; then - echo "" - echo "Applying ${gamename} Server Fixes" - echo "=================================" - sleep 1 - fix_kf.sh - elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then - echo "" - echo "Applying ${gamename} Server Fixes" - echo "=================================" - sleep 1 - fix_ro.sh - elif [ "${gamename}" == "Unreal Tournament 2004" ]; then - echo "" - echo "Applying ${gamename} Server Fixes" - echo "=================================" - sleep 1 - fix_ut2k4.sh - elif [ "${gamename}" == "Unreal Tournament" ]; then - echo "" - echo "Applying ${gamename} Server Fixes" - echo "=================================" - sleep 1 - fix_ut.sh - fi + if [ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then + echo "" + echo "Applying Post-Install Fixes" + echo "=================================" + fn_sleep_time + if [ "${shortname}" == "kf" ]; then + fix_kf.sh + elif [ "${shortname}" == "kf2" ]; then + fix_kf2.sh + elif [ "${shortname}" == "ro" ]; then + fix_ro.sh + elif [ "${shortname}" == "ut2k4" ]; then + fix_ut2k4.sh + elif [ "${shortname}" == "ut" ]; then + fix_ut.sh + elif [ "${shortname}" == "ut3" ]; then + fix_ut3.sh + else + fn_print_information_nl "No fixes required." + fi + fi fi diff --git a/lgsm/functions/fix_ark.sh b/lgsm/functions/fix_ark.sh new file mode 100644 index 000000000..e9be8ecaf --- /dev/null +++ b/lgsm/functions/fix_ark.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# LinuxGSM fix_ark.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves various issues with ARK: Survival Evolved. + +# Symlinking the SteamCMD directory into the correct ARK directory so that the mods auto-management will work. +if [ ! -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]; then + ln -s "${steamcmddir}" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" +fi + +if [ ! -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]; then + ln -s "$HOME/Steam/steamapps/" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" +fi \ No newline at end of file diff --git a/lgsm/functions/fix_arma3.sh b/lgsm/functions/fix_arma3.sh index e1bb4abcc..06e54f7cd 100644 --- a/lgsm/functions/fix_arma3.sh +++ b/lgsm/functions/fix_arma3.sh @@ -1,12 +1,12 @@ #!/bin/bash -# LGSM fix_arma3.sh function +# LinuxGSM fix_arma3.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Resolves an issue with ARMA3. local commandname="FIX" local commandaction="Fix" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: 20150 Segmentation fault (core dumped) error. if [ ! -d "${HOME}/.local/share/Arma 3" ]||[ ! -d "${HOME}/.local/share/Arma 3 - Other Profiles" ]; then diff --git a/lgsm/functions/fix_coduo.sh b/lgsm/functions/fix_coduo.sh index 09835eadb..9eb4e78d7 100644 --- a/lgsm/functions/fix_coduo.sh +++ b/lgsm/functions/fix_coduo.sh @@ -1,12 +1,11 @@ #!/bin/bash -# LGSM fix_coduo.sh function +# LinuxGSM fix_coduo.sh function # Author: Alexander Hurd -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Fixes for Call of Duty: United Offensive local commandname="FIX" local commandaction="Fix" -# Force glibc fix +# Force glibc fix. fix_glibc.sh - diff --git a/lgsm/functions/fix_csgo.sh b/lgsm/functions/fix_csgo.sh index 38d169532..4cf281851 100644 --- a/lgsm/functions/fix_csgo.sh +++ b/lgsm/functions/fix_csgo.sh @@ -1,45 +1,34 @@ #!/bin/bash -# LGSM fix_csgo.sh function +# LinuxGSM fix_csgo.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Resolves various issues with CS:GO. local commandname="FIX" local commandaction="Fix" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: server not always creating steam_appid.txt file. -if [ ! -f "${filesdir}/steam_appid.txt" ]; then +if [ ! -f "${serverfiles}/steam_appid.txt" ]; then fixname="730 steam_appid.txt" fn_fix_msg_start - echo -n "730" >> "${filesdir}/steam_appid.txt" + echo -n "730" >> "${serverfiles}/steam_appid.txt" fn_fix_msg_end fi # Fixes: Error parsing BotProfile.db - unknown attribute 'Rank'". -if ! grep -q "//Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then +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/\tRank/\t\/\/Rank/g' "${systemdir}/botprofile.db" > /dev/null 2>&1 + 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". -if ! grep -q "//exec default" "${servercfgdir}/valve.rc" > /dev/null 2>&1 || ! grep -q "//exec joystick" "${servercfgdir}/valve.rc" > /dev/null 2>&1; then +# 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/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 + 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 - -# Fixes: workshop map issue. -# 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 - fixname="workshop map" - fn_fix_msg_start - rm -f "${systemdir}/subscribed_collection_ids.txt" - rm -f "${systemdir}/subscribed_file_ids.txt" - rm -f "${systemdir}/ugc_collection_cache.txt" - fn_fix_msg_end -fi \ No newline at end of file diff --git a/lgsm/functions/fix_dst.sh b/lgsm/functions/fix_dst.sh index fea58b67e..e2850c8b8 100644 --- a/lgsm/functions/fix_dst.sh +++ b/lgsm/functions/fix_dst.sh @@ -1,18 +1,18 @@ #!/bin/bash -# LGSM fix_dst.sh function +# LinuxGSM fix_dst.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Resolves various issues with Don't Starve Together. local commandname="FIX" local commandaction="Fix" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer) +# Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer). # Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS. -if [ -f "/etc/redhat-release" ] && [ ! -f "${filesdir}/bin/lib32/libcurl-gnutls.so.4" ]; then - fixname="libcurl-gnutls.so.4 missing" +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" "${filesdir}/bin/lib32/libcurl-gnutls.so.4" + ln -s "/usr/lib/libcurl.so.4" "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" fn_fix_msg_end -fi \ No newline at end of file +fi diff --git a/lgsm/functions/fix_ges.sh b/lgsm/functions/fix_ges.sh index c8ee7ad5d..977697cca 100644 --- a/lgsm/functions/fix_ges.sh +++ b/lgsm/functions/fix_ges.sh @@ -1,7 +1,7 @@ #!/bin/bash -# LGSM fix_ges.sh function +# LinuxGSM fix_ges.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Resolves various issues with GoldenEye: Source. local commandname="FIX" diff --git a/lgsm/functions/fix_glibc.sh b/lgsm/functions/fix_glibc.sh deleted file mode 100644 index bd793d72a..000000000 --- a/lgsm/functions/fix_glibc.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# LGSM fix_glibc.sh function -# Author: Daniel Gibbs -# Website: https://gameservermanagers.com -# Description: Downloads required Glibc files and applies the Glibc fix if required. - -local commandname="FIX" -local commandaction="Fix" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" - -local libstdc_servers_array=( "ARMA 3" "Blade Symphony" "Garry's Mod" "GoldenEye: Source" "Just Cause 2" ) -for libstdc_server in "${libstdc_servers_array[@]}" -do - if [ "${gamename}" == "${libstdc_server}" ]; then - fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libstdc++.so.6" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5" - fi -done - -local libm_servers_array=( "Black Mesa: Deathmatch" "Codename CURE" "Day of Infamy" "Double Action: Boogaloo" "Empires Mod" "Fistful of Frags" "Garry's Mod" "GoldenEye: Source" "Insurgency" "Natural Selection 2" "NS2: Combat" "No More Room in Hell" ) -for libm_server in "${libm_servers_array[@]}" -do - if [ "${gamename}" == "${libm_server}" ]; then - fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libm.so.6" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5" - fi -done - -local libc_servers_array=( "Black Mesa: Deathmatch" "Blade Symphony" "Garry's Mod" "GoldenEye: Source" ) -for libc_server in "${libc_servers_array[@]}" -do - if [ "${gamename}" == "${libc_server}" ]; then - fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libc.so.6" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5" - fi -done - -local libpthread_servers_array=( "Black Mesa: Deathmatch" "Blade Symphony" "Garry's Mod" ) -for libpthread_server in "${libpthread_servers_array[@]}" -do - if [ "${gamename}" == "${libpthread_server}" ]; then - fn_fetch_file_github "lgsm/lib/ubuntu12.04/i386" "libpthread.so.0" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5" - fi -done - -if [ "${gamename}" == "Call of Duty: United Offensive" ]; then - fn_fetch_file_github "lgsm/lib/gcc3" "libgcc_s.so.1" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5" - fn_fetch_file_github "lgsm/lib/gcc3" "libstdc++.so.5.0.3" "${lgsmdir}/lib" "noexecutecmd" "norun" "noforce" "nomd5" - if [ ! -f "${lgsmdir}/lib/libstdc++.so.5" ]; then - ln -s "${lgsmdir}/lib/libstdc++.so.5.0.3" "${lgsmdir}/lib/libstdc++.so.5" - fi -fi - -export LD_LIBRARY_PATH=:"${libdir}" diff --git a/lgsm/functions/fix_ins.sh b/lgsm/functions/fix_ins.sh index 2fab8f8ae..354401ea5 100644 --- a/lgsm/functions/fix_ins.sh +++ b/lgsm/functions/fix_ins.sh @@ -1,7 +1,7 @@ #!/bin/bash -# LGSM fix_ins.sh function +# LinuxGSM fix_ins.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Resolves various issues with Insurgency. local commandname="FIX" @@ -9,7 +9,7 @@ local commandaction="Fix" # Fixes: ./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} +export LD_LIBRARY_PATH=${serverfiles}:${serverfiles}/bin:${LD_LIBRARY_PATH} # Fixes: issue #529 - gamemode not passed to debug or start. diff --git a/lgsm/functions/fix_kf.sh b/lgsm/functions/fix_kf.sh index c08a34341..e9f5f3860 100644 --- a/lgsm/functions/fix_kf.sh +++ b/lgsm/functions/fix_kf.sh @@ -1,29 +1,33 @@ #!/bin/bash -# LGSM fix_kf.sh function +# LinuxGSM fix_kf.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Resolves various issues with Killing Floor. local commandname="FIX" local commandaction="Fix" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo "Applying WebAdmin ROOst.css fix." echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" -sed -i 's/none}/none;/g' "${filesdir}/Web/ServerAdmin/ROOst.css" -sed -i 's/underline}/underline;/g' "${filesdir}/Web/ServerAdmin/ROOst.css" -sleep 1 +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 "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 +fn_sleep_time echo "applying server name fix." -sleep 1 +fn_sleep_time echo "forcing server restart..." -sleep 1 +fn_sleep_time +exitbypass=1 command_start.sh sleep 5 +exitbypass=1 command_stop.sh +exitbypass=1 command_start.sh sleep 5 +exitbypass=1 command_stop.sh \ No newline at end of file diff --git a/lgsm/functions/fix_kf2.sh b/lgsm/functions/fix_kf2.sh new file mode 100644 index 000000000..e8f3440f0 --- /dev/null +++ b/lgsm/functions/fix_kf2.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# LinuxGSM fix_kf2.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves various issues with Killing Floor 2. + +local commandname="FIX" +local commandaction="Fix" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_parms(){ +parms="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" +} + +fn_print_information "starting ${gamename} server to generate configs." +fn_sleep_time +exitbypass=1 +command_start.sh +sleep 10 +exitbypass=1 +command_stop.sh diff --git a/lgsm/functions/fix_mta.sh b/lgsm/functions/fix_mta.sh new file mode 100644 index 000000000..4eb4ff900 --- /dev/null +++ b/lgsm/functions/fix_mta.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LinuxGSM fix_mta.sh function +# Author: Daniel Gibbs +# Contributor: ChaosMTA +# Website: https://linuxgsm.com +# Description: Installs the libmysqlclient for database functions on the server +local commandname="FIX" +local commandaction="Fix" +local function_selfname="$(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 + +export LD_LIBRARY_PATH=:"${libdir}" diff --git a/lgsm/functions/fix_ro.sh b/lgsm/functions/fix_ro.sh index ee28aaf4a..1ded9824b 100644 --- a/lgsm/functions/fix_ro.sh +++ b/lgsm/functions/fix_ro.sh @@ -1,29 +1,36 @@ #!/bin/bash -# LGSM fix_ro.sh function +# LinuxGSM fix_ro.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Resolves various issues with Red Orchestra. local commandname="FIX" local commandaction="Fix" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo "Applying WebAdmin ROOst.css fix." echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" -sed -i 's/none}/none;/g' "${filesdir}/Web/ServerAdmin/ROOst.css" -sed -i 's/underline}/underline;/g' "${filesdir}/Web/ServerAdmin/ROOst.css" -sleep 1 +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 "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 +fn_sleep_time +echo "Applying Steam AppID fix." +sed -i 's/1210/1200/g' "${systemdir}/steam_appid.txt" +fn_sleep_time echo "applying server name fix." -sleep 1 +fn_sleep_time echo "forcing server restart..." -sleep 1 +fn_sleep_time +exitbypass=1 command_start.sh sleep 5 +exitbypass=1 command_stop.sh +exitbypass=1 command_start.sh sleep 5 -command_stop.sh \ No newline at end of file +exitbypass=1 +command_stop.sh diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh index ec0b125d4..854020873 100644 --- a/lgsm/functions/fix_rust.sh +++ b/lgsm/functions/fix_rust.sh @@ -1,11 +1,11 @@ #!/bin/bash -# LGSM fix_rust.sh function +# LinuxGSM fix_rust.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Resolves startup issue with Rust local commandname="FIX" local commandaction="Fix" -# Fixes: [Raknet] Server Shutting Down (Shutting Down) -export LD_LIBRARY_PATH="${systemdir}/RustDedicated_Data/Plugins/x86_64" +# Fixes: [Raknet] Server Shutting Down (Shutting Down). +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${systemdir}/RustDedicated_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_rw.sh b/lgsm/functions/fix_rw.sh new file mode 100644 index 000000000..3ce85a699 --- /dev/null +++ b/lgsm/functions/fix_rw.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_rw.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Rising World + +local commandname="FIX" +local commandaction="Fix" + +export LD_LIBRARY_PATH="${serverfiles}/linux64:${serverfiles}:$LD_LIBRARY_PATH" \ No newline at end of file diff --git a/lgsm/functions/fix_sdtd.sh b/lgsm/functions/fix_sdtd.sh new file mode 100644 index 000000000..04ac7936d --- /dev/null +++ b/lgsm/functions/fix_sdtd.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_sdtd.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves startup issue with 7 Days to Die + +local commandname="FIX" +local commandaction="Fix" + +export LD_LIBRARY_PATH="${serverfiles}" \ No newline at end of file diff --git a/lgsm/functions/fix_sof2.sh b/lgsm/functions/fix_sof2.sh new file mode 100644 index 000000000..2715f7f8c --- /dev/null +++ b/lgsm/functions/fix_sof2.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Soldier of Fortune 2 + +local commandname="FIX" +local commandaction="Fix" + +# Fixes: error while loading shared libraries: libcxa.so.1 +export LD_LIBRARY_PATH=":$LD_LIBRARY_PATH" diff --git a/lgsm/functions/fix_ss3.sh b/lgsm/functions/fix_ss3.sh new file mode 100644 index 000000000..73626f366 --- /dev/null +++ b/lgsm/functions/fix_ss3.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# LinuxGSM fix_ss3.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves various issues with Serious Sam 3. + +local commandname="FIX" +local commandaction="Fix" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes https://steamcommunity.com/app/41070/discussions/0/353916981477716386/ +if [ "$(diff "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" >/dev/null)" ]; then + fixname="steamclient.so" + fn_fix_msg_start + cp -f "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index 9f08fd36a..a3f60e89c 100644 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -1,43 +1,51 @@ #!/bin/bash -# LGSM fix_steamcmd.sh function +# LinuxGSM fix_steamcmd.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Resolves various issues related to SteamCMD. local commandname="FIX" local commandaction="Fix" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: [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 general" + fixname="steamclient.so" fn_fix_msg_start - mkdir -pv "${HOME}/.steam/sdk32" >> "${scriptlog}" - cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" >> "${scriptlog}" + mkdir -pv "${HOME}/.steam/sdk32" >> "${lgsmlog}" + cp -v "${steamcmddir}/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" >> "${lgsmlog}" fn_fix_msg_end fi -if [ "${gamename}" == "Serious Sam 3: BFE" ]; then +if [ "${shortname}" == "ss3" ]; then # Fixes: .steam/bin32/libsteam.so: cannot open shared object file: No such file or directory if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then fixname="libsteam.so" fn_fix_msg_start - mkdir -pv "${HOME}/.steam/bin32" >> "${scriptlog}" - cp -v "${filesdir}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" >> "${scriptlog}" + mkdir -pv "${HOME}/.steam/bin32" >> "${lgsmlog}" + cp "${serverfiles}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" >> "${lgsmlog}" fn_fix_msg_end fi -elif [ "${gamename}" == "Hurtworld" ]; then +elif [ "${shortname}" == "hw" ]; then # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. - if [ ! -f "${filesdir}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then + if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then fixname="steamclient.so x86" fn_fix_msg_start - cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${filesdir}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${scriptlog}" + cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${lgsmlog}" fn_fix_msg_end fi - if [ ! -f "${filesdir}/Hurtworld_Data/Plugins/x86_64/steamclient.so" ]; then + if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" ]; then fixname="steamclient.so x86_64" fn_fix_msg_start - cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${filesdir}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${scriptlog}" + cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}" + fn_fix_msg_end + fi +elif [ "${shortname}" == "tu" ]; then + # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. + if [ ! -f "${executabledir}/steamclient.so" ]; then + fixname="steamclient.so" + fn_fix_msg_start + cp -v "${serverfiles}/linux64/steamclient.so" "${executabledir}/steamclient.so" >> "${lgsmlog}" fn_fix_msg_end fi fi diff --git a/lgsm/functions/fix_terraria.sh b/lgsm/functions/fix_terraria.sh new file mode 100644 index 000000000..1a898d046 --- /dev/null +++ b/lgsm/functions/fix_terraria.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# LinuxGSM fix_terraria.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves an issue with Terraria. + +local commandname="FIX" +local commandaction="Fix" +local function_selfname="$(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 100644 index 000000000..26a31846e --- /dev/null +++ b/lgsm/functions/fix_tf2.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# LinuxGSM fix_tf2.sh function +# Author: Vector Sigma +# Website: https://github.com/vectorsigma +# Description: Resolves various issues with Team Fortress 2. + +local commandname="FIX" +local commandaction="Fix" +local function_selfname="$(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 100644 index 000000000..751b5dbd5 --- /dev/null +++ b/lgsm/functions/fix_ts3.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# LinuxGSM fix_ts3.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves various issues with Teamspeak 3. + +local commandname="FIX" +local commandaction="Fix" +local function_selfname="$(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 100644 index 000000000..bc29a54ed --- /dev/null +++ b/lgsm/functions/fix_unt.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Unturned + +local commandname="FIX" +local commandaction="Fix" + +# Fixes: [Raknet] Server Shutting Down (Shutting Down). +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${systemdir}/lib" diff --git a/lgsm/functions/fix_ut.sh b/lgsm/functions/fix_ut.sh index 74233406f..7e9b7dc97 100644 --- a/lgsm/functions/fix_ut.sh +++ b/lgsm/functions/fix_ut.sh @@ -1,14 +1,14 @@ #!/bin/bash -# LGSM fix_ut.sh function +# LinuxGSM fix_ut.sh function # Author: Alexander Hurd -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Resolves various issues with Unreal Tournament. local commandname="FIX" local commandaction="Fix" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" #Set Binary Executable echo "chmod +x ${executabledir}/${executable}" chmod +x "${executabledir}/${executable}" -sleep 1 \ No newline at end of file +fn_sleep_time \ No newline at end of file diff --git a/lgsm/functions/fix_ut2k4.sh b/lgsm/functions/fix_ut2k4.sh index 85b2334a7..3789909b3 100644 --- a/lgsm/functions/fix_ut2k4.sh +++ b/lgsm/functions/fix_ut2k4.sh @@ -1,29 +1,33 @@ #!/bin/bash -# LGSM fix_ut2k4.sh function +# LinuxGSM fix_ut2k4.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Resolves various issues with Unreal Tournament 2004. local commandname="FIX" local commandaction="Fix" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo "applying WebAdmin ut2003.css fix." echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" -sed -i 's/none}/none;/g' "${filesdir}/Web/ServerAdmin/ut2003.css" -sed -i 's/underline}/underline;/g' "${filesdir}/Web/ServerAdmin/ut2003.css" -sleep 1 +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 "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 +fn_sleep_time echo "applying server name fix." -sleep 1 -echo "forcing server restart..." -sleep 1 +fn_sleep_time +echo "forcing server restart." +fn_sleep_time +exitbypass=1 command_start.sh sleep 5 +exitbypass=1 command_stop.sh +exitbypass=1 command_start.sh sleep 5 +exitbypass=1 command_stop.sh \ No newline at end of file diff --git a/lgsm/functions/fix_ut3.sh b/lgsm/functions/fix_ut3.sh new file mode 100644 index 000000000..53bde310f --- /dev/null +++ b/lgsm/functions/fix_ut3.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# LinuxGSM fix_ut2.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves various issues with configs in Unreal Tournament 3. + +local commandname="FIX" +local commandaction="Fix" +local function_selfname="$(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=${servicename} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" +} + +fn_print_information "starting ${gamename} server to generate configs." +fn_sleep_time +exitbypass=1 +command_start.sh +sleep 10 +exitbypass=1 +command_stop.sh diff --git a/lgsm/functions/fix_wurm.sh b/lgsm/functions/fix_wurm.sh new file mode 100644 index 000000000..756636cac --- /dev/null +++ b/lgsm/functions/fix_wurm.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LinuxGSM fix_wurm.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves various issues with ARK: Survival Evolved. + +# Copies steamclient.so to correct location. +if [ ! -f "${serverfiles}/nativelibs" ]; then + cp -f "${serverfiles}/linux64/steamclient.so" "${serverfiles}/nativelibs" +fi + +# First run requires start with no parms. +# After first run new dirs are created. +if [ ! -d "${serverfiles}/Creative" ]; then + parmsbypass=1 + fixbypass=1 + exitbypass=1 + command_start.sh + sleep 10 + exitbypass=1 + command_stop.sh + unset parmsbypass +fi diff --git a/lgsm/functions/fn_functions b/lgsm/functions/fn_functions deleted file mode 100644 index 758af3dbc..000000000 --- a/lgsm/functions/fn_functions +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# LGSM fn_functions function -# Author: Daniel Gibbs -# Website: https://gameservermanagers.com -lgsm_version="211016" - -# Description: Redirects to new core_functions.sh - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_runfunction -} - -core_getopt.sh(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -core_functions.sh \ No newline at end of file diff --git a/lgsm/functions/fn_getopt b/lgsm/functions/fn_getopt deleted file mode 100644 index 0302cf1d5..000000000 --- a/lgsm/functions/fn_getopt +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# LGSM fn_getopt function -# Author: Daniel Gibbs -# Website: https://gameservermanagers.com -lgsm_version="211016" - -# Description: Redirect to new core_getopt.sh - -core_getopt.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_runfunction -} - -core_getopt.sh \ No newline at end of file diff --git a/lgsm/functions/fn_update_functions b/lgsm/functions/fn_update_functions deleted file mode 100644 index a424d3352..000000000 --- a/lgsm/functions/fn_update_functions +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# LGSM fn_update_functions function -# Author: Daniel Gibbs -# Website: https://gameservermanagers.com -lgsm_version="211016" - -# Description: LEGACY FUNCTION Deletes the functions dir to allow re-downloading of functions from GitHub. - -fn_print_dots "Updating functions" -sleep 1 -echo -ne "\n" -rm -rfv "${rootdir}/functions/"* -exitcode=$? -if [ "${exitcode}" == "0" ]; then - fn_print_ok "Updating functions" - fn_script_log "Success! Updating functions" -else - fn_print_fail "Updating functions" - fn_script_log "Failure! Updating functions" -fi -echo -ne "\n" \ No newline at end of file diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index ed5084855..c9be1af93 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -1,32 +1,33 @@ #!/bin/bash -# LGSM info_config.sh function +# LinuxGSM info_config.sh function # Author: Daniel Gibbs # Contributor: UltimateByte -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Gets specific details from config files. -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -## Examples of filtering to get info from config files +## Examples of filtering to get info from config files. # sed 's/foo//g' - remove foo # tr -cd '[:digit:]' leave only digits # tr -d '=\"; ' remove selected characters =\"; # grep -v "foo" filter out lines that contain foo # cut -f1 -d "/" remove everything after / -fn_info_config_avalanche(){ +fn_info_config_justcause2(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" port="${zero}" + queryport="${zero}" else - servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverdescription=$(grep "Description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - + queryport="${port}" ip=$(grep "BindIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/BindIP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') ipsetinconfig=1 ipinconfigvar="BindIP" @@ -36,6 +37,90 @@ fn_info_config_avalanche(){ serverpassword=${serverpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} port=${port:-"0"} + queryport=${queryport:-"0"} + fi +} + +fn_info_config_justcause3(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverdescription="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryPort="${zero}" + steamport="${zero}" + tickrate="${zero}" + else + servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverdescription=$(grep "description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "\"maxPlayers\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "\"port\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "\"queryPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + steamport=$(grep "\"steamPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + tickrate=$(grep "\"maxTickRate\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + + ip=$(grep "host" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/host//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="host" + + # Not Set + servername=${servername:-"NOT SET"} + serverdescription=${serverdescription:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers=:-"0"} + port=${port=:-"0"} + queryport=${queryport=:-"0"} + steamport=${steamport=:-"0"} + tickrate=${tickrate=:-"0"} + fi +} + +fn_info_config_ark(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + else + servername=$(grep "SessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/SessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + # Not Set + servername=${servername:-"NOT SET"} + fi +} + +fn_info_config_ballistic_overkill(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "ServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port + 1)) + maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + maxplayers=${maxplayers:-"NOT SET"} + fi +} + +fn_info_config_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 } @@ -94,6 +179,20 @@ fn_info_config_cod2(){ 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}" @@ -153,6 +252,75 @@ fn_info_config_dontstarve(){ fi } +fn_info_config_eco(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + gamemode="${unavailable}" + tickrate="${zero}" + port="${zero}" + webadminport="${zero}" + public="" + else + servername=$(grep "Description" "${servercfgdir}/Network.eco" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password" "${servercfgdir}/Network.eco" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxConnections" "${servercfgdir}/Network.eco" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/MaxConnections//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "\"GameServerPort\"" "${servercfgdir}/Network.eco" | tr -cd '[:digit:]') + webadminport=$(grep "\"WebServerPort\"" "${servercfgdir}/Network.eco" | tr -cd '[:digit:]') + public=$(grep "PublicServer" "${servercfgdir}/Network.eco" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers=:-"0"} + port=${port=:-"0"} + webadminport=${webadminport=:-"0"} + public=${public=:-"NOT SET"} + fi +} + +fn_info_config_factorio(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="Factorio Server" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + servername="Factorio Server" + serverpassword=$(grep "game_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "\"max_players\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers=:-"0"} + fi +} + +fn_info_config_inss(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconenabled="${unavailable}" + rconpassword="${unavailable}" + rconport="${zero}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + queryenabled="${unavailable}" + rconport="${zero}" + gamemode="${unavailable}" + gameworld="${unavailable}" + else + rconenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconport=$(grep "ListenPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + + # Not Set + rconenabled=${rconenabled:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"0"} + fi +} + fn_info_config_minecraft(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -160,6 +328,8 @@ fn_info_config_minecraft(){ rconport="${zero}" maxplayers="${zero}" port="${zero}" + queryport="${zero}" + queryenabled="${unavailable}" gamemode="${unavailable}" gameworld="${unavailable}" else @@ -168,6 +338,11 @@ fn_info_config_minecraft(){ rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport=$(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]*$//') @@ -181,9 +356,66 @@ fn_info_config_minecraft(){ 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 +} +#Post Scriptum: The bloody Seventh +fn_info_config_pstbs(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + numreservedslots="${unavailable}" + else + servername="$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//')" + maxplayers="$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]')" + numreservedslots="$(grep "NumReservedSlots=" "${servercfgfullpath}" | tr -cd '[:digit:]')" + 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 } @@ -213,12 +445,13 @@ fn_info_config_projectzomboid(){ fi } -fn_info_config_quake2(){ +fn_info_config_quakeworld(){ if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" + port="${zero}" else rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') @@ -231,27 +464,25 @@ fn_info_config_quake2(){ fi } -fn_info_config_quake3(){ +fn_info_config_quake2(){ 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:]') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not Set rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} fi } -fn_info_config_quakelive(){ +fn_info_config_quake3(){ if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" servername="${unavailable}" @@ -260,12 +491,8 @@ fn_info_config_quakelive(){ 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:]') - - ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="set net_ip" + 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"} @@ -295,19 +522,25 @@ fn_info_config_jk2(){ fi } -fn_info_config_wolfensteinenemyterritory(){ +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 - port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - 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:]') + rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + port=$(grep "net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + rconport=$(grep "zmq_rcon_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + statsport=$(grep "zmq_stats_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') ipsetinconfig=1 @@ -318,7 +551,10 @@ fn_info_config_wolfensteinenemyterritory(){ servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} - port=${port:-"27960"} + port=${port:-"0"} + queryport=${queryport:-"0"} + rconport=${rconport:-"0"} + statsport=${statsport:-"0"} fi } @@ -342,6 +578,60 @@ fn_info_config_realvirtuality(){ fi } +fn_info_config_risingworld(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + rconport="${zero}" + maxplayers="${zero}" + port="${zero}" + gamemode="${unavailable}" + gameworld="${unavailable}" + else + servername=$(grep "server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconport=$(grep "rcon_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + maxplayers=$(grep "settings_max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server_port" "${servercfgfullpath}" | grep -v "database_mysql_server_port" | grep -v "#" | tr -cd '[:digit:]') + gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + gameworld=$(grep "server_world_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_world_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + javaram=$(grep "server_memory" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_memory//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ip=$(grep "server_ip" "${servercfgfullpath}" | grep -v "database_mysql_server_ip" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="server-ip" + + # Not Set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} + fi +} + +fn_info_config_rtcw(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + fn_info_config_seriousengine35(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -365,6 +655,41 @@ fn_info_config_seriousengine35(){ 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}" @@ -385,6 +710,8 @@ fn_info_config_source(){ fn_info_config_starbound(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" + queryenabled="${unavailable}" + rconenabled="${unavailable}" rconpassword="${unavailable}" port="21025" queryport="21025" @@ -392,6 +719,8 @@ fn_info_config_starbound(){ 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:]') @@ -400,6 +729,8 @@ fn_info_config_starbound(){ # Not Set servername=${servername:-"NOT SET"} + queryenabled=${queryenabled:-"NOT SET"} + rconenabled=${rconenabled:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"} port=${port:-"21025"} queryport=${queryport:-"21025"} @@ -451,6 +782,27 @@ fn_info_config_mumble(){ 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" @@ -494,30 +846,46 @@ fn_info_config_terraria(){ 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}" gsqueryport="${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]*$//') - 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]*$//') + 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)) gsqueryport=$(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]*$//') + 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:]') if [ "${engine}" == "unreal" ]; then - webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - 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]*$//') + 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$//') else - webadminuser=$(grep "AdminName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + webadminuser=$(grep "AdminName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') webadminpass="${adminpassword}" fi @@ -526,6 +894,7 @@ fn_info_config_unreal(){ serverpassword=${serverpassword:-"NOT SET"} adminpassword=${adminpassword:-"NOT SET"} port=${port:-"0"} + queryport=${queryport:-"0"} gsqueryport=${gsqueryport:-"0"} webadminenabled=${webadminenabled:-"NOT SET"} webadminport=${webadminport:-"0"} @@ -534,6 +903,68 @@ fn_info_config_unreal(){ fi } +fn_info_config_unreal3(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${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]*$//') + adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + 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"} + port=${port:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + 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}" @@ -553,7 +984,7 @@ fn_info_config_sdtd(){ servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") port=$(grep "ServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port + 1)) + queryport=${port:-"0"} webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') @@ -583,71 +1014,337 @@ fn_info_config_sdtd(){ fi } -# Just Cause 2 -if [ "${engine}" == "avalanche" ]; then - fn_info_config_avalanche +fn_info_config_mta(){ + if [ ! -f "${servercfgfullpath}" ]; then + ip="${zero}" + port="${unavailable}" + httpport="${unavailable}" + ase="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + port=$(grep -m 1 "serverport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + httpport=$(grep -m 1 "httpport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + 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:]') + 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:]') + + if [ "${ase}" == "1" ]; then + ase="Enabled" + else + ase="Disabled" + fi + + ip=$(grep -m 1 "serverip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") + ipsetinconfig=1 + ipinconfigvar="serverip" + + # Not Set + port=${port:-"22003"} + httpport=${httpport:-"22005"} + ase=${ase:-"Disabled"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_wolfensteinenemyterritory(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="set net_ip" + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"27960"} + queryport=${queryport:-"27960"} + fi +} + +fn_info_config_etlegacy(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + rconpassword=$(grep "set rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="set net_ip" + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"27960"} + queryport=${queryport:-"27960"} + fi +} + +fn_info_config_wurmunlimited(){ + if [ ! -f "${servercfgfullpath}" ]; then + port="${zero}" + queryport="${zero}" + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + maxplayers="${zero}" + else + + port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + servername=$(grep "SERVERNAME=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "SERVERPASSWORD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "ADMINPWD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMINPWD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MAXPLAYERS=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + ip=$(grep "IP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/IP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="IP" + + # Not Set + port=${port:-"3724"} + queryport=${queryport:-"27017"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_squad(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + else + servername="$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')" + maxplayers="$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]')" + fi + + if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then + rconport=${unavailable} + rconpassword=${unavailable} + else + rconport=$(grep "Port=" "${servercfgdir}/Rcon.cfg" | tr -cd '[:digit:]') + rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + fi + + rconport=${rconport:-"0"} + if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then + rconpassword="NOT SET" + fi + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} +} + +fn_info_config_stationeers(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "SERVERNAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "PASSWORD" "${servercfgfullpath}" | grep "^PASSWORD" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/PASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "RCONPASSWORD" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/RCONPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MAXPLAYER" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/MAXPLAYER//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_mordhau(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') + serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') + rconpassword=$(grep "AdminPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "MaxSlots" "${servercfgfullpath}" | awk -F '=' '{print $2}') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +# ARK: Survival Evolved +if [ "${shortname}" == "ark" ]; then + fn_info_config_ark +# Ballistic Overkill +elif [ "${shortname}" == "bo" ]; then + fn_info_config_ballistic_overkill +# Battalion 1944 +elif [ "${shortname}" == "bt1944" ]; then + fn_info_config_battalion1944 # Battlefield: 1942 -elif [ "${gamename}" == "Battlefield: 1942" ]; then +elif [ "${shortname}" == "bf1942" ]; then fn_info_config_bf1942 # Call of Duty -elif [ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]; then +elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]; then fn_info_config_cod # Call of Duty 2 -elif [ "${gamename}" == "Call of Duty 2" ]; then +elif [ "${shortname}" == "cod2" ]; then fn_info_config_cod2 +# Call of Duty 4 +elif [ "${shortname}" == "cod4" ]; then + fn_info_config_cod4 # Call of Duty: World at War -elif [ "${gamename}" == "Call of Duty: World at War" ]; then +elif [ "${shortname}" == "codwaw" ]; then fn_info_config_codwaw # Dont Starve Together -elif [ "${engine}" == "dontstarve" ]; then +elif [ "${shortname}" == "dst" ]; then fn_info_config_dontstarve +# Eco +elif [ "${shortname}" == "eco" ]; then + fn_info_config_eco +# Factorio +elif [ "${shortname}" == "fctr" ]; then + fn_info_config_factorio +# Insurgency: Sandstorm +elif [ "${shortname}" == "inss" ]; then + fn_info_config_inss +# Just Cause 2 +elif [ "${shortname}" == "jc2" ]; then + fn_info_config_justcause2 +# Just Cause 3 +elif [ "${shortname}" == "jc3" ]; then + fn_info_config_justcause3 +# Killing Floor 2 +elif [ "${shortname}" == "kf2" ]; then + fn_info_config_kf2 +# QuakeWorld +elif [ "${shortname}" == "qw" ]; then + fn_info_config_quakeworld # Quake 2 -elif [ "${gamename}" == "Quake 2" ]; then +elif [ "${shortname}" == "q2" ]; then fn_info_config_quake2 # Quake 3 -elif [ "${gamename}" == "Quake 3: Arena" ]; then +elif [ "${shortname}" == "q3" ]; then fn_info_config_quake3 # Quake Live -elif [ "${gamename}" == "Quake Live" ]; then +elif [ "${shortname}" == "ql" ]; then fn_info_config_quakelive # Jedi Outcast elif [ "${gamename}" == "Jedi Knight II: Jedi Outcast" ]; then fn_info_config_jk2 # Minecraft -elif [ "${engine}" == "lwjgl2" ]; then +elif [ "${shortname}" == "mc" ]; then fn_info_config_minecraft +# Post Scriptum: The Bloody Seventh +elif [ "${shortname}" == "pstbs" ]; then + fn_info_config_pstbs +# Project Cars +elif [ "${shortname}" == "pc" ]; then + fn_info_config_projectcars # Project Zomboid -elif [ "${engine}" == "projectzomboid" ]; then +elif [ "${shortname}" == "pz" ]; then fn_info_config_projectzomboid # ARMA 3 -elif [ "${engine}" == "realvirtuality" ]; then +elif [ "${shortname}" == "arma3" ]; then fn_info_config_realvirtuality +# Return to Castle Wolfenstein +elif [ "${shortname}" == "rtcw" ]; then + fn_info_config_rtcw +# Rising World +elif [ "${shortname}" == "rw" ]; then + fn_info_config_risingworld # Serious Sam -elif [ "${engine}" == "seriousengine35" ]; then +elif [ "${shortname}" == "ss3" ]; then fn_info_config_seriousengine35 +# Soldier Of Fortune 2: Gold Edition +elif [ "${shortname}" == "sof2" ]; then + fn_info_config_sof2 # Source Engine Games elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then fn_info_config_source # Starbound -elif [ "${engine}" == "starbound" ]; then +elif [ "${shortname}" == "sb" ]; then fn_info_config_starbound # TeamSpeak 3 -elif [ "${gamename}" == "TeamSpeak 3" ]; then +elif [ "${shortname}" == "ts3" ]; then fn_info_config_teamspeak3 -elif [ "${gamename}" == "Mumble" ]; then +# Mumble +elif [ "${shortname}" == "mumble" ]; then fn_info_config_mumble +# San Andreas Multiplayer +elif [ "${shortname}" == "samp" ]; then + fn_info_config_samp +# StickyBots +elif [ "${shortname}" == "pstbs" ]; then + fn_info_config_sbots # Teeworlds -elif [ "${engine}" == "teeworlds" ]; then +elif [ "${shortname}" == "tw" ]; then fn_info_config_teeworlds # Terraria -elif [ "${engine}" == "terraria" ]; then +elif [ "${shortname}" == "terraria" ]; then fn_info_config_terraria +# Tower Unite +elif [ "${shortname}" == "tu" ]; then + fn_info_config_towerunite # Unreal/Unreal 2 engine elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then fn_info_config_unreal +# Unreal 3 engine +elif [ "${engine}" == "unreal3" ]; then + fn_info_config_unreal3 # 7 Day To Die (unity3d) -elif [ "${gamename}" == "7 Days To Die" ]; then +elif [ "${shortname}" == "sdtd" ]; then fn_info_config_sdtd -elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then +elif [ "${shortname}" == "wet" ]; then fn_info_config_wolfensteinenemyterritory +elif [ "${shortname}" == "etl" ]; then + fn_info_config_etlegacy +elif [ "${shortname}" == "wurm" ]; then + fn_info_config_wurmunlimited +elif [ "${shortname}" == "mta" ]; then + fn_info_config_mta +elif [ "${shortname}" == "squad" ]; then + fn_info_config_squad +# Stationeers +elif [ "${shortname}" == "st" ]; then + fn_info_config_stationeers +elif [ "${shortname}" == "mh" ]; then + fn_info_config_mordhau fi diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 16973cfc1..17faeb50a 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -1,11 +1,11 @@ #!/bin/bash -# LGSM info_distro.sh function +# LinuxGSM info_distro.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# 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. -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Distro information @@ -13,23 +13,53 @@ local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" # Returns architecture, kernel and distro/os. arch=$(uname -m) kernel=$(uname -r) -if [ -n "$(command -v lsb_release)" ]; then - distroname=$(lsb_release -s -d) -elif [ -f "/etc/os-release" ]; then - distroname=$(grep PRETTY_NAME /etc/os-release | sed 's/PRETTY_NAME=//g' | tr -d '="') -elif [ -f "/etc/debian_version" ]; then - distroname="Debian $(cat /etc/debian_version)" -elif [ -f "/etc/redhat-release" ]; then - distroname=$(cat /etc/redhat-release) -else - distroname="$(uname -s) $(uname -r)" -fi -if [ -f "/etc/os-release" ]; then - distroversion=$(grep VERSION_ID /etc/os-release | tr -cd '[:digit:]') -elif [ -n "$(command -v yum)" ]; then - distroversion=$(rpm -qa \*-release | grep -Ei "oracle|redhat|centos" | cut -d"-" -f3) -fi +# 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 [ -n "$(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 [ -n "$(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 @@ -37,12 +67,14 @@ glibcversion="$(ldd --version | sed -n '1s/.* //p')" ## tmux version # e.g: tmux 1.6 -if [ -z "$(command -v tmux)" ]; then +if [ -z "$(command -V tmux 2>/dev/null)" ]; then tmuxv="${red}NOT INSTALLED!${default}" -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) + if [ "$(tmux -V|sed "s/tmux //" | sed -n '1 p' | tr -cd '[:digit:]')" -lt "16" ] 2>/dev/null; then + tmuxv="$(tmux -V) (>= 1.6 required for console log)" + else + tmuxv=$(tmux -V) + fi fi ## Uptime @@ -52,33 +84,74 @@ minutes=$(( uptime/60%60 )) hours=$(( uptime/60/60%24 )) days=$(( uptime/60/60/24 )) - ### Performance information ## Average server load load=$(uptime|awk -F 'load average: ' '{ print $2 }') +## CPU information +cpumodel=$(awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//') +cpucores=$(awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo) +cpufreuency=$(awk -F: ' /cpu MHz/ {freq=$2} END {print freq " MHz"}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//') + ## Memory information # Available RAM and swap. -# Older versions of free do not support -h option. -if [ "$(free -h > /dev/null 2>&1; echo $?)" -ne "0" ]; then - humanreadable="-m" +# Newer distros can use numfmt to give more accurate results. +if [ -n "$(command -v numfmt 2>/dev/null)" ]; then + # Issue #2005 - Kernel 3.14+ contains MemAvailable which should be used. All others will be calculated. + + # 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") else - humanreadable="-h" -fi +# 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}') -physmemtotal=$(free ${humanreadable} | awk '/Mem:/ {print $2}') -physmemtotalmb=$(free -m | awk '/Mem:/ {print $2}') -physmemused=$(free ${humanreadable} | awk '/Mem:/ {print $3}') -physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}') -physmemcached=$(free ${humanreadable} | awk '/cache:/ {print $4}') -if [ -z "${physmemcached}" ]; then - physmemcached=$(free ${humanreadable} | awk '/Mem:/ {print $5}') + oldfree=$(free ${humanreadable} | awk '/cache:/') + if [ -n "${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 -swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}') -swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}') -swapfree=$(free ${humanreadable} | awk '/Swap:/ {print $4}') ### Disk information @@ -88,20 +161,20 @@ totalspace=$(df -hP "${rootdir}" | grep -v "Filesystem" | awk '{print $2}') usedspace=$(df -hP "${rootdir}" | grep -v "Filesystem" | awk '{print $3}') availspace=$(df -hP "${rootdir}" | grep -v "Filesystem" | awk '{print $4}') -## LGSM used space total. +## LinuxGSM used space total. rootdirdu=$(du -sh "${rootdir}" 2> /dev/null | awk '{print $1}') if [ -z "${rootdirdu}" ]; then rootdirdu="0M" fi -## LGSM used space in serverfiles dir. -filesdirdu=$(du -sh "${filesdir}" 2> /dev/null | awk '{print $1}') -if [ -z "${filesdirdu}" ]; then - filesdirdu="0M" +## LinuxGSM used space in serverfiles dir. +serverfilesdu=$(du -sh "${serverfiles}" 2> /dev/null | awk '{print $1}') +if [ -z "${serverfilesdu}" ]; then + serverfilesdu="0M" fi -## LGSM used space total minus backup dir. -rootdirduexbackup=$(du -sh --exclude="${backupdir}" "${filesdir}" 2> /dev/null | awk '{print $1}') +## 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 @@ -110,20 +183,20 @@ fi if [ -d "${backupdir}" ]; then # Used space in backups dir. backupdirdu=$(du -sh "${backupdir}" | awk '{print $1}') - # If no backup dir, size is 0M + # If no backup dir, size is 0M. if [ -z "${backupdirdu}" ]; then backupdirdu="0M" fi - # number of backups set to 0 by default + # number of backups set to 0 by default. backupcount=0 # If there are backups in backup dir. - if [ $(find "${backupdir}" -name "*.tar.gz" | wc -l) -ne "0" ]; then + 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=$(ls -t "${backupdir}"/*.tar.gz | head -1) + lastbackup=$(find "${backupdir}"/*.tar.gz | head -1) # date of most recent backup. lastbackupdate=$(date -r "${lastbackup}") # no of days since last backup. @@ -132,3 +205,52 @@ if [ -d "${backupdir}" ]; then lastbackupsize=$(du -h "${lastbackup}" | awk '{print $1}') fi fi + +# External IP address +if [ -z "${extip}" ]; then + extip=$(${curlpath} -4 -m 3 ifconfig.co 2>/dev/null) + exitcode=$? + # Should ifconfig.co return an error will use last known IP. + if [ ${exitcode} -eq 0 ]; then + echo "${extip}" > "${tmpdir}/extip.txt" + else + if [ -f "${tmpdir}/extip.txt" ]; then + extip=$(cat ${tmpdir}/extip.txt) + else + echo "x.x.x.x" + fi + fi +fi + +# Alert IP address +if [ "${displayip}" ]; then + alertip="${displayip}" +elif [ "${extip}" ]; then + alertip="${extip}" +else + alertip="${ip}" +fi + +# Steam Master Server - checks if detected by master server. +if [ "$(command -v jq 2>/dev/null)" ]; then + if [ "${ip}" ]&&[ "${port}" ]; then + if [ "${steammaster}" == "true" ]; then + masterserver=$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l) + if [ "${masterserver}" == "0" ]; then + masterserver=$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l) + fi + if [ "${masterserver}" == "0" ]; then + masterserver="false" + else + masterserver="true" + fi + fi + fi +fi + +# Sets the SteamCMD glibc requirement if the game server requirement is less or not required. +if [ -n "${appid}" ]; then + if [ "${glibc}" = "null" ]||[ -z "${glibc}" ]||[ "$(printf '%s\n'${glibc}'\n' "2.14" | sort -V | head -n 1)" != "2.14" ]; then + glibc="2.14" + fi +fi diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh deleted file mode 100644 index f37b3d142..000000000 --- a/lgsm/functions/info_glibc.sh +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/bash -# LGSM info_glibc.sh function -# Author: Daniel Gibbs -# Website: https://gameservermanagers.com -# Description: Stores details on servers Glibc requirements. - -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" - -if [ "${gamename}" == "Black Mesa: Deathmatch" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Blade Symphony" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "BrainBread 2" ]; then - glibcrequired="2.17" -elif [ "${gamename}" == "Call of Duty" ]; then - glibcrequired="2.1" - glibcfix="no" -elif [ "${gamename}" == "Call of Duty 2" ]; then - glibcrequired="2.1.3" - glibcfix="no" -elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then - glibcrequired="2.1" - glibcfix="no" -elif [ "${gamename}" == "Call of Duty: World at War" ]; then - glibcrequired="2.3.2" - glibcfix="no" -elif [ "${gamename}" == "Day of Infamy" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Double Action: Boogaloo" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Empires Mod" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Fistful of Frags" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Garry's Mod" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "GoldenEye: Source" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Insurgency" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Mumble" ]; then - glibcrequired="NOT REQUIRED" - glibcfix="no" -elif [ "${gamename}" == "No More Room in Hell" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Quake 2" ]; then - glibcrequired="NOT REQUIRED" - glibcfix="no" -elif [ "${gamename}" == "Quake 3: Arena" ]; then - glibcrequired="2.1" - glibcfix="no" -elif [ "${gamename}" == "Quake Live" ]; then - glibcrequired="2.15" - glibcfix="no" -elif [ "${gamename}" == "Jedi Knight II: Jedi Outcast" ]; then - glibcrequired="2.1" - glibcfix="no" -elif [ "${gamename}" == "TeamSpeak 3" ]; then - glibcrequired="NOT REQUIRED" - glibcfix="no" -elif [ "${gamename}" == "Teeworlds" ]; then - glibcrequired="2.3" - glibcfix="no" -elif [ "${engine}" == "avalanche" ]; then - glibcrequired="2.13" - glibcfix="yes" -elif [ "${engine}" == "dontstarve" ]; then - glibcrequired="2.15" - glibcfix="no" -elif [ "${engine}" == "lwjgl2" ]; then - glibcrequired="NOT REQUIRED" - glibcfix="no" -elif [ "${engine}" == "projectzomboid" ]; then - glibcrequired="2.15" - glibcfix="no" -elif [ "${engine}" == "realvirtuality" ]; then - glibcrequired="2.13" - glibcfix="yes" -elif [ "${engine}" == "seriousengine35" ]; then - glibcrequired="2.13" - glibcfix="yes" -elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then - glibcrequired="2.3.6" - glibcfix="no" -elif [ "${engine}" == "spark" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${engine}" == "starbound" ]; then - glibcrequired="2.17" - glibcfix="no" -elif [ "${engine}" == "quake" ]; then - glibcrequired="2.0" - glibcfix="no" -elif [ "${engine}" == "terraria" ]; then - glibcrequired="2.7" - glibcfix="no" -elif [ "${engine}" == "unreal" ]; then - glibcrequired="2.1" - glibcfix="no" -elif [ "${engine}" == "unreal2" ]; then - glibcrequired="2.4" - glibcfix="no" -elif [ "${engine}" == "unreal3" ]; then - glibcrequired="2.3.2" - glibcfix="no" -elif [ "${engine}" == "unreal4" ]; then - glibcrequired="2.14" - glibcfix="no" -elif [ "${engine}" == "unity3d" ]; then - glibcrequired="2.15" - glibcfix="no" -elif [ "${gamename}" == "TeamSpeak 3" ]; then - glibcrequired="NOT REQUIRED" - glibcfix="no" -elif [ "${gamename}" == "Mumble" ]; then - glibcrequired="NOT REQUIRED" - glibcfix="no" -elif [ "${engine}" == "refractor" ]; then - glibcrequired="2.0" - glibcfix="no" -elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then - glibcrequired="2.2.4" - glibcfix="no" -else - glibcrequired="UNKNOWN" - glibcfix="no" -fi diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh new file mode 100644 index 000000000..d8f7abd63 --- /dev/null +++ b/lgsm/functions/info_messages.sh @@ -0,0 +1,1366 @@ +#!/bin/bash +# LinuxGSM info_messages.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Defines server info messages for details and alerts. + +# 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 "${blue}Distro:\t${default}${distroname}" + echo -e "${blue}Arch:\t${default}${arch}" + echo -e "${blue}Kernel:\t${default}${kernel}" + echo -e "${blue}Hostname:\t${default}${HOSTNAME}" + echo -e "${blue}tmux:\t${default}${tmuxv}" + echo -e "${blue}glibc:\t${default}${glibcversion}" + } | column -s $'\t' -t +} + +fn_info_message_performance(){ + # + # Performance + # ===================================== + # Uptime: 55d, 3h, 38m + # Avg Load: 1.00, 1.01, 0.78 + # + # Mem: total used free cached + # Physical: 741M 656M 85M 256M + # Swap: 0B 0B 0B + + echo -e "" + echo -e "${lightyellow}Performance${default}" + + { + echo -e "${blue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m" + echo -e "${blue}Avg Load:\t${default}${load}" + } | column -s $'\t' -t + echo -e "" + { + echo -e "${blue}CPU Model:\t${default}${cpumodel}" + echo -e "${blue}CPU Cores:\t${default}${cpucores}" + echo -e "${blue}CPU Frequency:\t${default}${cpufreuency}" + } | column -s $'\t' -t + echo -e "" + { + echo -e "${blue}Mem:\t${blue}total\tused\tfree\tcached\tavailable${default}" + echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}" + echo -e "${blue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}" + } | column -s $'\t' -t +} + +fn_info_message_disk(){ + # + # Storage + # ===================================== + # Filesystem: /dev/disk/by-uuid/320c8edd-a2ce-4a23-8c9d-e00a7af2d6ff + # Total: 15G + # Used: 8.4G + # Available: 5.7G + # LinuxGSM Total: 1G + # Serverfiles: 961M + # Backups: 2G + + echo -e "" + echo -e "${lightyellow}Storage${default}" + fn_messages_separator + { + echo -e "${blue}Filesystem:\t${default}${filesystem}" + echo -e "${blue}Total:\t${default}${totalspace}" + echo -e "${blue}Used:\t${default}${usedspace}" + echo -e "${blue}Available:\t${default}${availspace}" + echo -e "${blue}LinuxGSM Total:\t${default}${rootdirdu}" + echo -e "${blue}Serverfiles:\t${default}${serverfilesdu}" + if [ -d "${backupdir}" ]; then + echo -e "${blue}Backups:\t${default}${backupdirdu}" + fi + } | column -s $'\t' -t +} + +fn_info_message_gameserver(){ + # + # Quake Live Server Details + # ===================================== + # Server name: ql-server + # Server IP: 1.2.3.4:27960 + # RCON password: CHANGE_ME + # Server password: NOT SET + # Maxplayers: 16 + # Status: OFFLINE + + 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 "${blue}Server name:\t${default}${gdname}" + elif [ -n "${servername}" ]; then + echo -e "${blue}Server name:\t${default}${servername}" + fi + + # Server description + if [ -n "${serverdescription}" ]; then + echo -e "${blue}Server Description:\t${default}${serverdescription}" + fi + + # Branch + if [ -n "${branch}" ]; then + echo -e "${blue}Branch:\t${default}${branch}" + fi + + # Server ip + if [ "${multiple_ip}" == "1" ]; then + echo -e "${blue}Server IP:\t${default}NOT SET" + else + echo -e "${blue}Server IP:\t${default}${ip}:${port}" + fi + + # Internet ip + if [ -n "${extip}" ]; then + if [ "${ip}" != "${extip}" ]; then + echo -e "${blue}Internet IP:\t${default}${extip}:${port}" + fi + fi + + # Display ip + if [ -n "${displayip}" ]; then + echo -e "${blue}Display IP:\t${default}${displayip}:${port}" + fi + + # Server password + if [ -n "${serverpassword}" ]; then + echo -e "${blue}Server password:\t${default}${serverpassword}" + fi + + # Query enabled (Starbound) + if [ -n "${queryenabled}" ]; then + echo -e "${blue}Query enabled:\t${default}${queryenabled}" + fi + + # RCON enabled (Starbound) + if [ -n "${rconenabled}" ]; then + echo -e "${blue}RCON enabled:\t${default}${rconpassword}" + fi + + # RCON password + if [ -n "${rconpassword}" ]; then + echo -e "${blue}RCON password:\t${default}${rconpassword}" + fi + + # RCON web (Rust) + if [ -n "${rconweb}" ]; then + echo -e "${blue}RCON web:\t${default}${rconweb}" + fi + + # Admin password + if [ -n "${adminpassword}" ]; then + echo -e "${blue}Admin password:\t${default}${adminpassword}" + fi + + # Stats password (Quake Live) + if [ -n "${statspassword}" ]; then + echo -e "${blue}Stats password:\t${default}${statspassword}" + fi + + # Players + + if [ "${querystatus}" != "0" ]; then + if [ -n "${maxplayers}" ]; then + echo -e "${blue}Maxplayers:\t${default}${maxplayers}" + fi + else + if [ -n "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then + echo -e "${blue}Players:\t${default}${gdplayers}/${gdmaxplayers}" + + elif [ -n "${gdplayers}" ]&&[ -n "${maxplayers}" ]; then + echo -e "${blue}Players:\t${default}${gdplayers}/${maxplayers}" + + elif [ -z "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then + echo -e "${blue}Players:\t${default}0/${gdmaxplayers}" + + elif [ -n "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]; then + echo -e "${blue}Players:\t${default}${gdplayers}|∞" + + elif [ -z "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]&&[ -n "${maxplayers}" ]; then + echo -e "${blue}Maxplayers:\t${default}${maxplayers}" + fi + fi + + # Bots + if [ -n "${gdbots}" ]; then + echo -e "${blue}Bots:\t${default}${gdbots}" + fi + + # Current Map + if [ -n "${gdmap}" ]; then + echo -e "${blue}Current Map:\t${default}${gdmap}" + fi + + if [ -n "${defaultscenario}" ]; then + # Current Scenario + if [ -n "${gdgamemode}" ]; then + echo -e "${blue}Current Scenario:\t${default}${gdgamemode}" + fi + else + # Current Scenario + if [ -n "${gdgamemode}" ]; then + echo -e "${blue}Current Game Mode:\t${default}${gdgamemode}" + fi + fi + + # Default Map + if [ -n "${defaultmap}" ]; then + echo -e "${blue}Default Map:\t${default}${defaultmap}" + fi + + # Default Scenario + if [ -n "${defaultscenario}" ]; then + echo -e "${blue}Default Scenario:\t${default}${defaultscenario}" + fi + + # Game type + if [ -n "${gametype}" ]; then + echo -e "${blue}Game type:\t${default}${gametype}" + fi + + # Game mode + if [ -n "${gamemode}" ]; then + echo -e "${blue}Game mode:\t${default}${gamemode}" + fi + + # Game world + if [ -n "${gameworld}" ]; then + echo -e "${blue}Game world:\t${default}${gameworld}" + fi + + # Tick rate + if [ -n "${tickrate}" ]; then + echo -e "${blue}Tick rate:\t${default}${tickrate}" + fi + + # Sharding (Don't Starve Together) + if [ -n "${sharding}" ]; then + echo -e "${blue}Sharding:\t${default}${sharding}" + fi + + # Master (Don't Starve Together) + if [ -n "${master}" ]; then + echo -e "${blue}Master:\t${default}${master}" + fi + + # Shard (Don't Starve Together) + if [ -n "${shard}" ]; then + echo -e "${blue}Shard:\t${default}${shard}" + fi + + # Cluster (Don't Starve Together) + if [ -n "${cluster}" ]; then + echo -e "${blue}Cluster:\t${default}${cluster}" + fi + + # Cave (Don't Starve Together) + if [ -n "${cave}" ]; then + echo -e "${blue}Cave:\t${default}${cave}" + fi + + # Creativemode (Hurtworld) + if [ -n "${creativemode}" ]; then + echo -e "${blue}Creativemode:\t${default}${creativemode}" + fi + + # TeamSpeak dbplugin + if [ -n "${dbplugin}" ]; then + echo -e "${blue}dbplugin:\t${default}${dbplugin}" + fi + + # ASE (Multi Theft Auto) + if [ -n "${ase}" ]; then + echo -e "${blue}ASE:\t${default}${ase}" + fi + + # Save interval (Rust) + if [ -n "${saveinterval}" ]; then + echo -e "${blue}ASE:\t${default}${saveinterval} s" + fi + + # Random map rotation mode (Squad and Post Scriptum) + if [ -n "${randommap}" ]; then + echo -e "${blue}Map rotation:\t${default}${randommap}" + fi + + # Listed on Master Server + if [ "${masterserver}" ];then + if [ "${masterserver}" == "true" ];then + echo -e "${blue}Master Server:\t${green}${masterserver}${default}" + else + echo -e "${blue}Master Server:\t${red}${masterserver}${default}" + fi + fi + + # Online status + if [ "${status}" == "0" ]; then + echo -e "${blue}Status:\t${red}OFFLINE${default}" + else + echo -e "${blue}Status:\t${green}ONLINE${default}" + fi + } | column -s $'\t' -t + echo -e "" +} + +fn_info_message_script(){ + # + # qlserver Script Details + # ===================================== + # Service name: ql-server + # qlserver version: 150316 + # User: lgsm + # Email alert: off + # Update on start: off + # Location: /home/lgsm/qlserver + # Config file: /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg + + echo -e "${lightgreen}${selfname} Script Details${default}" + fn_messages_separator + { + # Service name + echo -e "${blue}Service name:\t${default}${servicename}" + + # Script version + if [ -n "${version}" ]; then + echo -e "${blue}${selfname} version:\t${default}${version}" + fi + + # User + echo -e "${blue}User:\t${default}$(whoami)" + + # glibc required + if [ -n "${glibc}" ]; then + if [ "${glibc}" == "null" ]; then + # Glibc is not required. + : + elif [ -z "${glibc}" ]; then + echo -e "${blue}glibc required:\t${red}UNKNOWN${default}" + elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then + echo -e "${blue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})" + else + echo -e "${blue}glibc required:\t${green}${glibc}${default}" + fi + fi + + # Discord alert + echo -e "${blue}Discord alert:\t${default}${discordalert}" + # Email alert + echo -e "${blue}Email alert:\t${default}${emailalert}" + # Pushbullet alert + echo -e "${blue}Pushbullet alert:\t${default}${pushbulletalert}" + # IFTTT alert + echo -e "${blue}IFTTT alert:\t${default}${iftttalert}" + # Mailgun alert + echo -e "${blue}Mailgun (email) alert:\t${default}${mailgunalert}" + # Pushover alert + echo -e "${blue}Pushover alert:\t${default}${pushoveralert}" + # Telegram alert + echo -e "${blue}Telegram alert:\t${default}${telegramalert}" + # Update on start + if [ -n "${updateonstart}" ]; then + echo -e "${blue}Update on start:\t${default}${updateonstart}" + fi + + # Script location + echo -e "${blue}Location:\t${default}${rootdir}" + + # Config file location + if [ -n "${servercfgfullpath}" ]; then + if [ -f "${servercfgfullpath}" ]; then + echo -e "${blue}Config file:\t${default}${servercfgfullpath}" + elif [ -d "${servercfgfullpath}" ]; then + echo -e "${blue}Config dir:\t${default}${servercfgfullpath}" + else + echo -e "${blue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})" + fi + fi + + # Network config file location (ARMA 3) + if [ -n "${networkcfgfullpath}" ]; then + echo -e "${blue}Network config file:\t${default}${networkcfgfullpath}" + 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 "${blue}No. of backups:\t${default}${backupcount}" + echo -e "${blue}Latest backup:${default}" + if [ "${lastbackupdaysago}" == "0" ]; then + echo -e "${blue} date:\t${default}${lastbackupdate} (less than 1 day ago)" + elif [ "${lastbackupdaysago}" == "1" ]; then + echo -e "${blue} date:\t${default}${lastbackupdate} (1 day ago)" + else + echo -e "${blue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)" + fi + echo -e "${blue} file:\t${default}${lastbackup}" + echo -e "${blue} size:\t${default}${lastbackupsize}" + } | column -s $'\t' -t + fi +} + +fn_info_message_commandlineparms(){ + # + # Command-line Parameters + # ===================================== + # ./run_server_x86.sh +set net_strict 1 + + echo -e "" + echo -e "${lightgreen}Command-line Parameters${default}" + fn_info_message_password_strip + fn_messages_separator + if [ "${serverpassword}" == "NOT SET" ]; then + unset serverpassword + fi + fn_parms + echo -e "${executable} ${parms}" +} + +fn_info_message_ports(){ + # Ports + # ===================================== + # Change ports by editing the parameters in: + # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg + + echo -e "" + echo -e "${lightgreen}Ports${default}" + fn_messages_separator + echo -e "Change ports by editing the parameters in:" + + parmslocation="${red}UNKNOWN${default}" + # engines/games that require editing in the config file + local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "wurm" ) + 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=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "Rust" "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 "Useful port diagnostic command:" +} + +fn_info_message_statusbottom(){ + echo -e "" + if [ "${status}" == "0" ]; then + echo -e "${blue}Status:\t${red}OFFLINE${default}" + else + echo -e "${blue}Status:\t${green}ONLINE${default}" + fi + echo -e "" +} + +fn_info_logs(){ + echo -e "" + echo -e "${servicename} Logs" + echo -e "=================================" + + if [ -n "${lgsmlog}" ]; then + echo -e "\nScript log\n===================" + if [ ! "$(ls -A "${lgsmlogdir}")" ]; then + echo "${lgsmlogdir} (NO LOG FILES)" + elif [ ! -s "${lgsmlog}" ]; then + echo "${lgsmlog} (LOG FILE IS EMPTY)" + else + echo "${lgsmlog}" + tail -25 "${lgsmlog}" + fi + echo "" + fi + + if [ -n "${consolelog}" ]; then + echo -e "\nConsole log\n====================" + if [ ! "$(ls -A "${consolelogdir}")" ]; then + echo "${consolelogdir} (NO LOG FILES)" + elif [ ! -s "${consolelog}" ]; then + echo "${consolelog} (LOG FILE IS EMPTY)" + else + echo "${consolelog}" + tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }' + fi + echo "" + fi + + if [ -n "${gamelogdir}" ]; then + echo -e "\nServer log\n===================" + if [ ! "$(ls -A "${gamelogdir}")" ]; then + echo "${gamelogdir} (NO LOG FILES)" + else + echo "${gamelogdir}" + # dos2unix sed 's/\r//' + tail "${gamelogdir}"/* 2>/dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25 + fi + echo "" + fi +} + +# Engine/Game Specific details + +fn_info_message_ark(){ + echo -e "netstat -atunp | grep ShooterGame" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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_ballisticoverkill(){ + echo -e "netstat -atunp | grep BODS.x86" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_cod2(){ + echo -e "netstat -atunp | grep cod2_lnxded" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_cod4(){ + echo -e "netstat -atunp" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_dontstarve(){ + echo -e "netstat -atunp | grep dontstarve" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game: Server\tINBOUND\t${port}\tudp" + echo -e "> Game: Master\tINBOUND\t${masterport}\tudp" + echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp" + echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_eco(){ + echo -e "netstat -atunp | grep mono" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_factorio(){ + echo -e "netstat -atunp | grep factorio" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_goldsource(){ + echo -e "netstat -atunp | grep hlds_linux" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_justcause2(){ + echo -e "netstat -atunp | grep Jcmp-Server" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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_mumble(){ + echo -e "netstat -atunp | grep murmur" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 java" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_quake(){ + echo -e "netstat -atunp | grep mvdsv" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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_realvirtuality(){ + echo -e "netstat -atunp | grep arma3server" + echo -e "" + # Default port + if [ -z "${port}" ]; then + port="2302" + fi + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "> Steam: Query\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_refractor(){ + echo -e "netstat -atunp | grep bf1942_lnxd" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game/Query\tINBOUND\t${port}\tudp" + echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_risingworld(){ + echo -e "netstat -atunp | grep java" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp" + echo -e "> http query\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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" + } | column -s $'\t' -t +} + + +fn_info_message_seriousengine35(){ + 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_info_message_sbots(){ + echo -e "netstat -atunp | grep blank1" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "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 "${lightgreen}${servername} WebAdmin${default}" + fn_messages_separator + { + echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}" + echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}" + echo -e "${blue}WebAdmin password:\t${default}${webadminpass}" + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} Telnet${default}" + fn_messages_separator + { + echo -e "${blue}Telnet enabled:\t${default}${telnetenabled}" + echo -e "${blue}Telnet address:\t${default}${ip} ${telnetport}" + echo -e "${blue}Telnet password:\t${default}${telnetpass}" + } | column -s $'\t' -t +} + +fn_info_message_sof2(){ + echo -e "netstat -atunp | grep sof2ded" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "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 "${lightgreen}${servername} WebAdmin${default}" + fn_messages_separator + { + echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html" + echo -e "${blue}WebAdmin username:\t${default}${webadminuser}" + echo -e "${blue}WebAdmin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_squad(){ + echo -e "netstat -atunp | grep SquadServer" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "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_info_message_stationeers(){ + echo -e "netstat -atunp | grep rocketstation" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "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_info_message_teeworlds(){ + 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_info_message_terraria(){ + echo -e "netstat -atunp | grep TerrariaServer" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "> 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\tINBOUND\t20610\tudp" + else + echo -e "< Steam\tINBOUND\t20660\tudp" + fi + fi + echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} WebAdmin${default}" + fn_messages_separator + { + echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}" + echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}" + echo -e "${blue}WebAdmin username:\t${default}${webadminuser}" + echo -e "${blue}WebAdmin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_unreal3(){ + echo -e "netstat -atunp | grep ut3-bin" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} WebAdmin${default}" + fn_messages_separator + { + echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}" + echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}" + echo -e "${blue}WebAdmin username:\t${default}${webadminuser}" + echo -e "${blue}WebAdmin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_unturned(){ + echo -e "netstat -atunp | grep Unturned" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_kf2(){ + echo -e "netstat -atunp | grep KFGame" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> Steam\tINBOUND\t20560\tudp" + echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} WebAdmin${default}" + fn_messages_separator + { + echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}" + echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}" + echo -e "${blue}WebAdmin username:\t${default}${webadminuser}" + echo -e "${blue}WebAdmin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_wolfensteinenemyterritory(){ + echo -e "netstat -atunp | grep etded" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game/Query\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_etlegacy(){ + echo -e "netstat -atunp | grep etlded" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game/Query\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_wurmunlimited(){ + echo -e "netstat -atunp | grep WurmServer" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\ttcp" + echo -e "> Game/Query\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_mta(){ + echo -e "netstat -atunp | grep mta-server64" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tOUTBOUND\t${port}\tudp" + echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp" + if [ "${ase}" == "Enabled" ]; then + echo -e "> ASE Game_Monitor\tOUTBOUND\t$((${port} + 123))\tudp" + fi + } | column -s $'\t' -t +} + +fn_info_message_mordhau(){ + echo -e "netstat -atunp | grep Mord" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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_select_engine(){ + # Display details depending on game or engine. + if [ "${gamename}" == "7 Days To Die" ]; then + fn_info_message_sdtd + elif [ "${gamename}" == "ARK: Survival Evolved" ]; then + fn_info_message_ark + elif [ "${gamename}" == "Ballistic Overkill" ]; then + fn_info_message_ballisticoverkill + elif [ "${gamename}" == "Battalion 1944" ]; then + fn_info_message_battalion1944 + elif [ "${gamename}" == "Call of Duty" ]; then + fn_info_message_cod + elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then + fn_info_message_coduo + elif [ "${gamename}" == "Call of Duty 2" ]; then + fn_info_message_cod2 + elif [ "${gamename}" == "Call of Duty 4" ]; then + fn_info_message_cod4 + elif [ "${gamename}" == "Call of Duty: World at War" ]; then + fn_info_message_codwaw + elif [ "${gamename}" == "Eco" ]; then + fn_info_message_eco + elif [ "${gamename}" == "ET: Legacy" ]; then + fn_info_message_etlegacy + elif [ "${gamename}" == "Factorio" ]; then + fn_info_message_factorio + elif [ "${gamename}" == "Hurtworld" ]; then + fn_info_message_hurtworld + elif [ "${shortname}" == "inss" ]; then + fn_info_message_inss + elif [ "${gamename}" == "Just Cause 2" ]; then + fn_info_message_justcause2 + elif [ "${gamename}" == "Just Cause 3" ]; then + fn_info_message_justcause3 + elif [ "${shortname}" == "kf2" ]; then + fn_info_message_kf2 + elif [ "${shortname}" == "pstbs" ]; then + fn_info_message_pstbs + elif [ "${gamename}" == "Project Cars" ]; then + fn_info_message_projectcars + elif [ "${gamename}" == "QuakeWorld" ]; then + fn_info_message_quake + elif [ "${gamename}" == "Quake 2" ]; then + fn_info_message_quake2 + elif [ "${gamename}" == "Quake 3: Arena" ]; then + fn_info_message_quake3 + elif [ "${gamename}" == "Quake Live" ]; then + fn_info_message_quakelive + elif [ "${gamename}" == "San Andreas Multiplayer" ]; then + fn_info_message_samp + elif [ "${gamename}" == "Squad" ]; then + fn_info_message_squad + elif [ "${gamename}" == "Stationeers" ]; then + fn_info_message_stationeers + elif [ "${shortname}" == "sbots" ]; then + fn_info_message_sbots + elif [ "${gamename}" == "TeamSpeak 3" ]; then + fn_info_message_teamspeak3 + elif [ "${gamename}" == "Tower Unite" ]; then + fn_info_message_towerunite + elif [ "${shortname}" == "unt" ]; then + fn_info_message_unturned + elif [ "${shortname}" == "mh" ]; then + fn_info_message_mordhau + elif [ "${gamename}" == "Multi Theft Auto" ]; then + fn_info_message_mta + elif [ "${gamename}" == "Mumble" ]; then + fn_info_message_mumble + elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then + fn_info_message_rtcw + elif [ "${gamename}" == "Rust" ]; then + fn_info_message_rust + elif [ "${gamename}" == "Wurm Unlimited" ]; then + fn_info_message_wurmunlimited + elif [ "${shortname}" == "rw" ]; then + fn_info_message_risingworld + elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then + fn_info_message_wolfensteinenemyterritory + elif [ "${engine}" == "refractor" ]; then + fn_info_message_refractor + elif [ "${engine}" == "dontstarve" ]; then + fn_info_message_dontstarve + elif [ "${engine}" == "goldsource" ]; then + fn_info_message_goldsource + elif [ "${engine}" == "lwjgl2" ]; then + fn_info_message_minecraft + elif [ "${engine}" == "projectzomboid" ]; then + fn_info_message_projectzomboid + elif [ "${engine}" == "realvirtuality" ]; then + fn_info_message_realvirtuality + elif [ "${engine}" == "seriousengine35" ]; then + fn_info_message_seriousengine35 + elif [ "${engine}" == "source" ]; then + fn_info_message_source + elif [ "${gamename}" == "Soldier Of Fortune 2: Gold Edition" ]; then + fn_info_message_sof2 + elif [ "${engine}" == "spark" ]; then + fn_info_message_spark + elif [ "${engine}" == "starbound" ]; then + fn_info_message_starbound + elif [ "${engine}" == "teeworlds" ]; then + fn_info_message_teeworlds + elif [ "${engine}" == "terraria" ]; then + fn_info_message_terraria + elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then + fn_info_message_unreal + 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 [ "${function_selfname}" == "command_details.sh" ]; 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 [ "${function_selfname}" != "command_details.sh" ]; then + if [ -n "${serverpassword}" ]; then + serverpassword="********" + fi + + if [ -n "${rconpassword}" ]; then + rconpassword="********" + fi + + if [ -n "${adminpassword}" ]; then + adminpassword="********" + fi + + if [ -n "${statspassword}" ]; then + statspassword="********" + fi + + if [ -n "${webadminpass}" ]; then + webadminpass="********" + fi + + if [ -n "${telnetpass}" ]; then + telnetpass="********" + fi + + if [ -n "${wsapikey}" ]; then + wsapikey="********" + fi + + if [ -n "${gslt}" ]; then + gslt="********" + fi + + fi +} diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index 72ef857c9..7b080036d 100644 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -1,10 +1,10 @@ #!/bin/bash -# LGSM info_parms.sh function +# LinuxGSM info_parms.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com -# Description: Gets specific details from server parameters. +# Website: https://linuxgsm.com +# Description: If specific parms are not set then this will be displayed in details. -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ## Examples of filtering to get info from config files # sed 's/foo//g' - remove foo @@ -15,139 +15,240 @@ local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" unavailable="${red}UNAVAILABLE${default}" zero="${red}0${default}" -fn_info_config_quakelive(){ - # Not Set - port=${port:-"NOT SET"} +fn_info_parms_ark(){ + port=${port:-"0"} + queryport=${queryport:-"0"} + rconport=${rconport:-"0"} + maxplayers=${maxplayers:-"0"} +} + +fn_info_parms_realvirtuality(){ + port=${port:-"0"} + queryport=$((port + 1)) +} + +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_eco(){ + queryport=${webadminport} +} + +fn_info_parms_factorio(){ + port=${port:-"0"} rconport=${rconport:-"0"} rconpassword=${rconpassword:-"NOT SET"} - statsport=${statsport:-"0"} - statspassword=${statspassword:-"NOT SET"} - mappool=${mappool:-"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_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_projectzomboid(){ + adminpassword=${adminpassword:-"NOT SET"} +} + +fn_info_parms_quakeworld(){ + port=${port:-"0"} + queryport=${port} +} + +fn_info_parms_quake2(){ + port=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_parms_risingworld(){ + servername=${servername:-"NOT SET"} + port=${port:-"0"} + queryport=${port} + httpqueryport=$((port - 1)) + +} + +fn_info_parms_rtcw(){ + port=${port:-"0"} + queryport="${port}" + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_parms_rust(){ + servername=${servername:-"NOT SET"} + port=${port:-"0"} + queryport=${port} + rconport=${rconport:-"0"} rconpassword=${rconpassword:-"NOT SET"} + rconweb=${rconweb:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + saveinterval=${saveinterval:-"0"} + tickrate=${tickrate:-"0"} +} + +fn_info_parms_sof2(){ + port=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} } -fn_info_config_source(){ +fn_info_parms_source(){ defaultmap=${defaultmap:-"NOT SET"} maxplayers=${maxplayers:-"0"} port=${port:-"0"} + queryport=${port} clientport=${clientport:-"0"} } -fn_info_config_spark(){ - # Not Set +fn_info_parms_spark(){ + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} port=${port:-"0"} queryport=$((port + 1)) - maxplayers=${maxplayers:-"0"} + 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} + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_parms_towerunite(){ + port=${port:-"0"} + queryport=${queryport:-"0"} +} + +fn_info_parms_mordhau(){ + port=${port:-"0"} + queryport=${queryport:-"0"} + beaconport=${beaconport:-"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"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} +} + +fn_info_parms_unturned(){ + servername=${servicename:-"NOT SET"} + port=${port:-"0"} + queryport=$((port + 1)) +} +fn_info_parms_kf2(){ + queryport=${queryport:-"0"} + defaultmap=${defaultmap:-"NOT SET"} } -fn_info_config_teeworlds(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="unnamed server" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - port="8303" - maxplayers="12" - else - servername=$(grep "sv_name" "${servercfgfullpath}" | sed 's/sv_name //g' | sed 's/"//g') - serverpassword=$(grep "password " "${servercfgfullpath}" | awk '!/sv_rcon_password/'| sed 's/password //g' | tr -d '=\"; ') - rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed 's/sv_rcon_password //g' | tr -d '=\"; ') - port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd '[:digit:]') - maxplayers=$(grep "sv_max_clients" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"8303"} - maxplayers=${maxplayers:-"12"} - fi -} - -fn_info_config_terraria(){ - if [ ! -f "${servercfgfullpath}" ]; then - port="0" - else - port=$(grep "port=" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not Set - port=${port:-"0"} - fi -} - -fn_info_config_unreal(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port="${zero}" - gsqueryport="${zero}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" - else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed 's/ServerName=//g') - serverpassword=$(grep "GamePassword=" "${servercfgfullpath}" | sed 's/GamePassword=//g') - adminpassword=$(grep "AdminPassword=" "${servercfgfullpath}" | sed 's/AdminPassword=//g') - port=$(grep "Port=" "${servercfgfullpath}" | grep -v "Master" | grep -v "LAN" | grep -v "Proxy" | grep -v "Listen" | tr -d '\r' | tr -cd '[:digit:]') - gsqueryport=$(grep "OldQueryPortNumber=" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled=" "${servercfgfullpath}" | sed 's/bEnabled=//g' | tr -d '\r') - webadminport=$(grep "ListenPort=" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]') - if [ "${engine}" == "unreal" ]; then - webadminuser=$(grep "AdminUsername=" "${servercfgfullpath}" | sed 's/\AdminUsername=//g') - webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 2 | grep "AdminPassword=" | sed 's/\AdminPassword=//g') - else - webadminuser=$(grep "AdminName=" "${servercfgfullpath}" | sed 's/\AdminName=//g') - webadminpass=$(grep "AdminPassword=" "${servercfgfullpath}" | sed 's/\AdminPassword=//g') - fi - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - gsqueryport=${gsqueryport:-"NOT SET"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"NOT SET"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - fi -} - -## Just Cause 2 -if [ "${engine}" == "avalanche" ]; then - fn_info_config_avalanche -## Dont Starve Together -elif [ "${engine}" == "dontstarve" ]; then - fn_info_config_dontstarve -## Project Zomboid -elif [ "${engine}" == "projectzomboid" ]; then - fn_info_config_projectzomboid -# Quake Live -elif [ "${gamename}" == "Quake Live" ]; then - fn_info_config_quakelive +# ARK: Survival Evolved +if [ "${shortname}" == "ark" ]; then + fn_info_parms_ark # ARMA 3 -elif [ "${engine}" == "realvirtuality" ]; then - fn_info_config_realvirtuality +elif [ "${shortname}" == "arma3" ]; then + fn_info_parms_realvirtuality +# Call of Duty +elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${engine}" == "iw2.0" ]||[ "${engine}" == "iw3.0" ]; then + fn_info_parms_cod +# Eco +elif [ "${shortname}" == "eco" ]; then + fn_info_parms_eco +# Factorio +elif [ "${shortname}" == "fctr" ]; then + fn_info_parms_factorio +elif [ "${shortname}" == "inss" ]; then + fn_info_parms_inss +elif [ "${shortname}" == "kf2" ]; then + fn_info_parms_kf2 +# Project Zomboid +elif [ "${shortname}" == "pz" ]; then + fn_info_parms_projectzomboid +elif [ "${shortname}" == "qw" ]; then + fn_info_parms_quakeworld +elif [ "${shortname}" == "q2" ]||[ "${shortname}" == "q3" ]; then + fn_info_parms_quake2 +elif [ "${shortname}" == "rtcw" ]; then + fn_info_parms_rtcw +# Rust +elif [ "${shortname}" == "rust" ]; then + fn_info_parms_rust +# Rising World +elif [ "${shortname}" == "rw" ]; then + fn_info_parms_risingworld +# Soldier Of Fortune 2: Gold Edition +elif [ "${shortname}" == "sof2" ]; then + fn_info_parms_sof2 +# Sticky Bots +elif [ "${shortname}" == "sbots" ]; then + fn_info_parms_stickybots # Serious Sam -elif [ "${engine}" == "seriousengine35" ]; then - fn_info_config_seriousengine35 -# Source Engine Games +elif [ "${shortname}" == "ss3" ]; then + fn_info_parms_seriousengine35 elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then - fn_info_config_source + fn_info_parms_source # Spark elif [ "${engine}" == "spark" ]; then - fn_info_config_spark -# Teeworlds -elif [ "${engine}" == "teeworlds" ]; then - fn_info_config_teeworlds -# Terraria -elif [ "${engine}" == "terraria" ]; then - fn_info_config_terraria + fn_info_parms_spark +elif [ "${shortname}" == "tu" ]; then + fn_info_parms_towerunite +elif [ "${shortname}" == "mh" ]; then + fn_info_parms_mordhau # Unreal/Unreal 2 engine elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then - fn_info_config_unreal + fn_info_parms_unreal +# Unreal 3 engine +elif [ "${engine}" == "unreal3" ]; then + fn_info_parms_unreal3 +elif [ "${shortname}" == "unt" ]; then + fn_info_parms_unturned fi diff --git a/lgsm/functions/install_complete.sh b/lgsm/functions/install_complete.sh index 4a38d79b4..18cfc16e5 100644 --- a/lgsm/functions/install_complete.sh +++ b/lgsm/functions/install_complete.sh @@ -1,13 +1,14 @@ #!/bin/bash -# LGSM install_complete.sh function +# LinuxGSM install_complete.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Prints installation completion message and hints. local commandname="INSTALL" local commandaction="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +echo "" echo "=================================" echo "Install Complete!" fn_script_log_info "Install Complete!" @@ -15,4 +16,4 @@ echo "" echo "To start server type:" echo "./${selfname} start" echo "" -core_exit.sh \ No newline at end of file +core_exit.sh diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 4e4c594cd..29c6aabdf 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -1,42 +1,14 @@ #!/bin/bash -# LGSM install_config.sh function +# LinuxGSM install_config.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Creates default server configs. local commandname="INSTALL" local commandaction="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_fetch_default_config(){ - mkdir -pv "${lgsmdir}/default-configs" - githuburl="https://github.com/nateberkopec/Game-Server-Configs/master" - - for config in "${array_configs[@]}" - do - fileurl="https://raw.githubusercontent.com/nateberkopec/Game-Server-Configs/master/${gamedirname}/${config}"; filedir="${lgsmdir}/default-configs"; filename="${config}"; executecmd="noexecute" run="norun"; force="noforce" - fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}" - done -} - -# Changes some variables within the default configs -# SERVERNAME to LinuxGSM -# PASSWORD to random password -fn_set_config_vars(){ - random=$(strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 8 | tr -d '\n'; echo) - servername="LinuxGSM" - rconpass="admin$random" - echo "changing hostname." - fn_script_log_info "changing hostname." - sleep 1 - sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}" - echo "changing rcon/admin password." - fn_script_log_info "changing rcon/admin password." - sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}" - sleep 1 -} - -# Checks if cfg dir exists, creates it if it doesn't +# Checks if server cfg dir exists, creates it if it doesn't. fn_check_cfgdir(){ if [ ! -d "${servercfgdir}" ]; then echo "creating ${servercfgdir} config directory." @@ -45,51 +17,107 @@ fn_check_cfgdir(){ fi } -# Copys the default configs from Game-Server-Configs repo to the -# correct location +# Downloads default configs from Game-Server-Configs repo to lgsm/config-default. +fn_fetch_default_config(){ + echo "" + echo "Downloading ${gamename} Configs" + echo "=================================" + echo "default configs from https://github.com/GameServerManagers/Game-Server-Configs" + 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}" "${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 + for config in "${array_configs[@]}"; do # every config is copied echo "copying ${config} config file." fn_script_log_info "copying ${servercfg} config file." if [ "${config}" == "${servercfgdefault}" ]; then - cp -v "${lgsmdir}/default-configs/${config}" "${servercfgfullpath}" + mkdir -p "${servercfgdir}" + cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" elif [ "${gamename}" == "ARMA 3" ]&&[ "${config}" == "${networkcfgdefault}" ]; then - cp -v "${lgsmdir}/default-configs/${config}" "${networkcfgfullpath}" + mkdir -p "${servercfgdir}" + cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}" elif [ "${gamename}" == "Don't Starve Together" ]&&[ "${config}" == "${clustercfgdefault}" ]; then - cp -nv "${lgsmdir}/default-configs/${clustercfgdefault}" "${clustercfgfullpath}" + cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" else - cp -v "${lgsmdir}/default-configs/${config}" "${servercfgdir}/${config}" + mkdir -p "${servercfgdir}" + cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}" fi done - sleep 1 + fn_sleep_time +} + +# Copys local default config to server config location. +fn_default_config_local(){ + echo "copying ${servercfgdefault} config file." + cp -nv "${servercfgfullpathdefault}" "${servercfgfullpath}" + fn_sleep_time } -# Changes some variables within the default Don't Starve Together configs +# 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 "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 "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 "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 "changing server name." fn_script_log_info "changing server name." sed -i "s/SERVERNAME/LinuxGSM/g" "${clustercfgfullpath}" - sleep 1 + fn_sleep_time echo "changing shard mode." fn_script_log_info "changing shard mode." sed -i "s/USESHARDING/${sharding}/g" "${clustercfgfullpath}" - sleep 1 + fn_sleep_time echo "randomizing cluster key." fn_script_log_info "randomizing cluster key." - randomkey=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) + randomkey=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) sed -i "s/CLUSTERKEY/${randomkey}/g" "${clustercfgfullpath}" - sleep 1 + fn_sleep_time else echo "${clustercfg} is already configured." fn_script_log_info "${clustercfg} is already configured." fi ## server.ini - # removing unnecessary options (dependent on sharding & shard type) + # removing unnecessary options (dependent on sharding & shard type). if [ "${sharding}" == "false" ]; then sed -i "s/ISMASTER//g" "${servercfgfullpath}" sed -i "/SHARDNAME/d" "${servercfgfullpath}" @@ -100,11 +128,11 @@ fn_set_dst_config_vars(){ echo "changing shard name." fn_script_log_info "changing shard name." sed -i "s/SHARDNAME/${shard}/g" "${servercfgfullpath}" - sleep 1 + fn_sleep_time echo "changing master setting." fn_script_log_info "changing master setting." sed -i "s/ISMASTER/${master}/g" "${servercfgfullpath}" - sleep 1 + fn_sleep_time ## worldgenoverride.lua if [ "${cave}" == "true" ]; then @@ -112,23 +140,16 @@ fn_set_dst_config_vars(){ fn_script_log_info "defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua." echo 'return { override_enabled = true, preset = "DST_CAVE", }' > "${servercfgdir}/worldgenoverride.lua" fi - sleep 1 + fn_sleep_time echo "" } -echo "" -echo "Downloading ${gamename} Config" -echo "=================================" -echo "default configs from https://github.com/GameServerManagers/Game-Server-Configs" -sleep 2 if [ "${gamename}" == "7 Days To Die" ]; then gamedirname="7DaysToDie" - array_configs+=( serverconfig.xml ) - fn_fetch_default_config - fn_default_config_remote - fn_set_config_vars -elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then + fn_default_config_local +elif [ "${gamename}" == "ARK: Survival Evolved" ]; then gamedirname="ARKSurvivalEvolved" + fn_check_cfgdir array_configs+=( GameUserSettings.ini ) fn_fetch_default_config fn_default_config_remote @@ -140,6 +161,25 @@ elif [ "${gamename}" == "ARMA 3" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "Ballistic Overkill" ]; then + gamedirname="BallisticOverkill" + array_configs+=( config.txt ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${gamename}" == "Base Defense" ]; then + gamedirname="BaseDefense" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${gamename}" == "Battalion 1944" ]; then + gamedirname="Battalion1944" + fn_check_cfgdir + array_configs+=( DefaultGame.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "Battlefield: 1942" ]; then gamedirname="Battlefield1942" array_configs+=( serversettings.con ) @@ -152,6 +192,12 @@ elif [ "${gamename}" == "Blade Symphony" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "BrainBread" ]; then + gamedirname="BrainBread" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "BrainBread 2" ]; then gamedirname="BrainBread2" array_configs+=( server.cfg ) @@ -177,7 +223,13 @@ elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then fn_default_config_remote fn_set_config_vars elif [ "${gamename}" == "Call of Duty 2" ]; then - gamedirname="CallofDuty2" + gamedirname="CallOfDuty2" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${gamename}" == "Call of Duty 4" ]; then + gamedirname="CallOfDuty4" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote @@ -212,6 +264,12 @@ elif [ "${gamename}" == "Counter-Strike: Global Offensive" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "Classic Offensive" ]; then + gamedirname="ClassicOffensive" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "Counter-Strike: Source" ]; then gamedirname="CounterStrikeSource" array_configs+=( server.cfg ) @@ -255,6 +313,24 @@ elif [ "${gamename}" == "Double Action: Boogaloo" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "Dystopia" ]; then + gamedirname="Dystopia" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${gamename}" == "ET: Legacy" ]; then + gamedirname="ETLegacy" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${gamename}" == "Factorio" ]; then + gamedirname="Factorio" + array_configs+=( server-settings.json ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "Fistful of Frags" ]; then gamedirname="FistfulofFrags" array_configs+=( server.cfg ) @@ -303,12 +379,24 @@ elif [ "${gamename}" == "Insurgency" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "IOSoccer" ]; then + gamedirname="IOSoccer" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "Just Cause 2" ]; then gamedirname="JustCause2" array_configs+=( config.lua ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "Just Cause 3" ]; then + gamedirname="JustCause3" + array_configs+=( config.json ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "Killing Floor" ]; then gamedirname="KillingFloor" array_configs+=( Default.ini ) @@ -339,21 +427,42 @@ elif [ "${gamename}" == "Minecraft" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "MORDHAU" ]; then + gamedirname="Mordhau" + fn_check_cfgdir + array_configs+=( Game.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${gamename}" == "Natural Selection" ]; then + gamedirname="NaturalSelection" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "No More Room in Hell" ]; then gamedirname="NoMoreRoominHell" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "Nuclear Dawn" ]; then + gamedirname="NuclearDawn" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${gamename}" == "Multi Theft Auto" ]; then + gamedirname="MultiTheftAuto" + fn_check_cfgdir + array_configs+=( acl.xml mtaserver.conf vehiclecolors.conf ) + fn_fetch_default_config + fn_default_config_remote elif [ "${gamename}" == "Mumble" ]; then gamedirname="Mumble" array_configs+=( murmur.ini ) fn_fetch_default_config fn_default_config_remote -elif [ "${gamename}" == "Natural Selection 2" ]; then - : -elif [ "${gamename}" == "NS2: Combat" ]; then - : elif [ "${gamename}" == "Pirates, Vikings, and Knights II" ]; then gamedirname="PiratesVikingandKnightsII" array_configs+=( server.cfg ) @@ -367,6 +476,12 @@ elif [ "${gamename}" == "Project Zomboid" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "Project Cars" ]; then + gamedirname="ProjectCars" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "Quake 2" ]; then gamedirname="Quake2" array_configs+=( server.cfg ) @@ -397,14 +512,18 @@ elif [ "${gamename}" == "QuakeWorld" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then - : elif [ "${gamename}" == "Ricochet" ]; then gamedirname="Ricochet" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then + gamedirname="ReturnToCastleWolfenstein" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "Rust" ]; then gamedirname="Rust" fn_check_cfgdir @@ -417,12 +536,36 @@ elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "Soldier Of Fortune 2: Gold Edition" ]; then + gamedirname="SoldierOfFortune2Gold" + array_configs+=( server.cfg mapcycle.txt) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${gamename}" == "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 elif [ "${gamename}" == "Starbound" ]; then gamedirname="Starbound" array_configs+=( starbound_server.config ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "Stationeers" ]; then + gamedirname="Stationeers" + array_configs+=( default.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${gamename}" == "San Andreas Multiplayer" ]; then + gamedirname="SanAndreasMultiplayer" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "Sven Co-op" ]; then gamedirname="SvenCoop" array_configs+=( server.cfg ) @@ -458,6 +601,13 @@ elif [ "${gamename}" == "Terraria" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "Tower Unite" ]; then + gamedirname="TowerUnite" + fn_check_cfgdir + array_configs+=( TowerServer.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "Unreal Tournament" ]; then gamedirname="UnrealTournament" array_configs+=( Game.ini Engine.ini ) @@ -470,22 +620,40 @@ elif [ "${gamename}" == "Unreal Tournament 2004" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Unreal Tournament 3" ]; then - gamedirname="UnrealTournament3" - array_configs+=( UTGame.ini ) - fn_fetch_default_config - fn_default_config_remote - fn_set_config_vars elif [ "${gamename}" == "Unreal Tournament 99" ]; then gamedirname="UnrealTournament99" array_configs+=( Default.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${shortname}" == "unt" ]; then + gamedirname="Unturned" + array_configs+=( Config.json ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${gamename}" == "Vampire Slayer" ]; then + gamedirname="VampireSlayer" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then gamedirname="WolfensteinEnemyTerritory" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "Wurm Unlimited" ]; then + gamedirname="WurmUnlimited" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${gamename}" == "Zombie Panic! Source" ]; then + gamedirname="ZombiePanicSource" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars fi diff --git a/lgsm/functions/install_dst_token.sh b/lgsm/functions/install_dst_token.sh index 2e9713e71..616a6469b 100644 --- a/lgsm/functions/install_dst_token.sh +++ b/lgsm/functions/install_dst_token.sh @@ -1,39 +1,36 @@ #!/bin/bash -# LGSM install_dst_token.sh function +# LinuxGSM install_dst_token.sh function # Author: Daniel Gibbs & Marvin Lehmann (marvinl97) -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Configures Don't Starve Together cluster with given token. local commandname="INSTALL" local commandaction="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo "" echo "Enter ${gamename} Cluster Token" echo "=================================" -sleep 1 +fn_sleep_time echo "A cluster token is required to run this server!" echo "Follow the instructions in this link to obtain this key:" -echo "https://gameservermanagers.com/dst-auth-token" +echo "https://linuxgsm.com/dst-auth-token" echo "" if [ -z "${autoinstall}" ]; then overwritetoken="true" if [ -s "${clustercfgdir}/cluster_token.txt" ]; then echo "The cluster token is already set. Do you want to overwrite it?" fn_script_log_info "Don't Starve Together cluster token is already set" - while true; do - read -e -i "n" -p "Continue? [Y/n]" yn - case $yn in - [Yy]* ) overwritetoken="true"; break;; - [Nn]* ) overwritetoken="false"; break;; - * ) echo "Please answer yes or no.";; - esac - done - fi + if fn_prompt_yn "Continue?" N; then + overwritetoken="true" + else + overwritetoken="false" + fi + fi if [ "${overwritetoken}" == "true" ]; then echo "Once you have the cluster token, enter it below" echo -n "Cluster Token: " - read token + read -r token mkdir -pv "${clustercfgdir}" echo "${token}" > "${clustercfgdir}/cluster_token.txt" if [ -f "${clustercfgdir}/cluster_token.txt" ]; then diff --git a/lgsm/functions/install_eula.sh b/lgsm/functions/install_eula.sh new file mode 100644 index 000000000..fca4838af --- /dev/null +++ b/lgsm/functions/install_eula.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# LinuxGSM install_eula.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Gets user to accept the EULA. + +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 "" +echo "Accept ${gamename} EULA" +echo "=================================" +fn_sleep_time +echo "You are required to accept the EULA:" +echo "${eulaurl}" +echo "" +if [ -z "${autoinstall}" ]; then + echo "By continuing you are indicating your agreement to the EULA." + echo "" + if ! fn_prompt_yn "Continue?" Y; then + core_exit.sh + fi +elif [ "${function_selfname}" == "command_start.sh" ]; then + fn_print_info "By continuing you are indicating your agreement to the EULA." + echo "" + sleep 5 +else + echo "By using auto-install you are indicating your agreement to the EULA." + echo "" + sleep 5 +fi + +if [ "${shortname}" == "ts3" ]; then + touch "${executabledir}/.ts3server_license_accepted" +elif [ "${shortname}" == "mc" ]; then + touch "${serverfiles}/eula.txt" + echo "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 100644 index 000000000..804ef88e7 --- /dev/null +++ b/lgsm/functions/install_factorio_save.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# LinuxGSM install_factorio_save.sh function +# Author: Kristian Polso +# Website: https://linuxgsm.com +# Description: Creates the initial save file for Factorio + +local commandname="INSTALL" +local commandaction="Install" + +echo "" +echo "Creating initial Factorio savefile" +echo "=================================" +fn_sleep_time +check_glibc.sh +"${executabledir}"/factorio --create "${serverfiles}/save1" diff --git a/lgsm/functions/install_gslt.sh b/lgsm/functions/install_gslt.sh index c611e91a3..87fccae70 100644 --- a/lgsm/functions/install_gslt.sh +++ b/lgsm/functions/install_gslt.sh @@ -1,18 +1,18 @@ #!/bin/bash -# LGSM install_gslt.sh function +# LinuxGSM install_gslt.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Configures GSLT. local commandname="INSTALL" local commandaction="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo "" echo "Game Server Login Token" echo "=================================" -sleep 1 -if [ "${gamename}" == "Counter-Strike: Global Offensive" ]||[ "${gamename}" == "Counter-Strike: Source" ]; then +fn_sleep_time +if [ "${shortname}" == "csgo" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "bs" ]; then echo "GSLT is required to run a public ${gamename} server" fn_script_log_info "GSLT is required to run a public ${gamename} server" else @@ -21,17 +21,28 @@ else fi echo "Get more info and a token here:" -echo "https://gameservermanagers.com/gslt" +echo "https://linuxgsm.com/gslt" fn_script_log_info "Get more info and a token here:" -fn_script_log_info "https://gameservermanagers.com/gslt" +fn_script_log_info "https://linuxgsm.com/gslt" echo "" if [ -z "${autoinstall}" ]; then - echo "Enter token below (Can be blank)." - echo -n "GSLT TOKEN: " - read token - sed -i -e "s/gslt=\"\"/gslt=\"${token}\"/g" "${rootdir}/${selfname}" + if [ "${shortname}" != "tu" ]; then + echo "Enter token below (Can be blank)." + echo -n "GSLT TOKEN: " + read -r token + if ! grep -q "^gslt=" "${configdirserver}/${servicename}.cfg" > /dev/null 2>&1; then + echo -e "\ngslt=\"${token}\"" >> "${configdirserver}/${servicename}.cfg" + else + sed -i -e "s/gslt=\"[^\"]*\"/gslt=\"${token}\"/g" "${configdirserver}/${servicename}.cfg" + fi + fi fi -sleep 1 -echo "The GSLT can be changed by editing ${selfname}." -fn_script_log_info "The GSLT can be changed by editing ${selfname}." -echo "" \ No newline at end of file +fn_sleep_time +if [ "${shortname}" == "tu" ]; then + echo "The GSLT can be changed by editing ${servercfgdir}/${servercfg}." + fn_script_log_info "The GSLT can be changed by editing ${servercfgdir}/${servercfg}." +else + echo "The GSLT can be changed by editing ${configdirserver}/${servicename}.cfg." + fn_script_log_info "The GSLT can be changed by editing ${configdirserver}/${servicename}.cfg." +fi +echo "" diff --git a/lgsm/functions/install_header.sh b/lgsm/functions/install_header.sh index 499d1aec9..40c2845fc 100644 --- a/lgsm/functions/install_header.sh +++ b/lgsm/functions/install_header.sh @@ -1,18 +1,18 @@ #!/bin/bash -# LGSM install_header.sh function +# LinuxGSM install_header.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Prints installation header. local commandname="INSTALL" local commandaction="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" clear echo "=================================" -echo "${gamename}" -echo "Linux Game Server Manager" +echo "LinuxGSM - ${gamename}" echo "by Daniel Gibbs" -echo "Contributors: http://goo.gl/qLmitD" -echo "https://gameservermanagers.com" +echo "Website: https://linuxgsm.com" +echo "Contributors: https://linuxgsm.com/contrib" +echo "Donate: https://linuxgsm.com/donate" echo "=================================" diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh index abad81329..c886c9140 100644 --- a/lgsm/functions/install_logs.sh +++ b/lgsm/functions/install_logs.sh @@ -1,45 +1,106 @@ #!/bin/bash -# LGSM install_logs.sh function +# LinuxGSM install_logs.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Creates log directories. local commandname="INSTALL" local commandaction="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${checklogs}" != "1" ]; then echo "" echo "Creating log directories" echo "=================================" fi -sleep 1 -# Create dir's for the script and console logs -mkdir -v "${rootdir}/log" -mkdir -v "${scriptlogdir}" -touch "${scriptlog}" +fn_sleep_time +# Create LinuxGSM logs. +echo -en "installing log dir: ${logdir}..." +mkdir -p "${logdir}" +if [ $? -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh +else + fn_print_ok_eol_nl +fi + +echo -en "installing LinuxGSM log dir: ${lgsmlogdir}..." +mkdir -p "${lgsmlogdir}" +if [ $? -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh +else + fn_print_ok_eol_nl +fi +echo -en "creating LinuxGSM log: ${lgsmlog}..." +touch "${lgsmlog}" +if [ $? -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh +else + fn_print_ok_eol_nl +fi +# Create Console logs. if [ -n "${consolelogdir}" ]; then - mkdir -v "${consolelogdir}" + echo -en "installing console log dir: ${consolelogdir}..." + mkdir -p "${consolelogdir}" + if [ $? -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + echo -en "creating console log: ${consolelog}..." touch "${consolelog}" + if [ $? -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi 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" ]||[ "${engine}" == "unreal" ]; then - if [ ! -h "${rootdir}/log/server" ]; then - ln -nfsv "${gamelogdir}" "${rootdir}/log/server" +# Create Game logs. +if [ -n "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then + echo -en "installing game log dir: ${gamelogdir}..." + mkdir -p "${gamelogdir}" + if [ $? -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl fi fi -# If a server is unreal2 or unity3d create a dir. -if [ "${engine}" == "unreal2" ]||[ "${engine}" == "unity3d" ]||[ "${gamename}" == "Teeworlds" ]||[ "${gamename}" == "seriousengine35" ]; then - mkdir -pv "${gamelogdir}" +# Symlink to gamelogdir +# unless gamelogdir is within logdir. +# e.g serverfiles/log is not within log/: symlink created +# log/server is in log/: symlink not created +if [ -n "${gamelogdir}" ]; then + if [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ]; then + echo -en "creating symlink to game log dir: ${logdir}/server -> ${gamelogdir}..." + ln -nfs "${gamelogdir}" "${logdir}/server" + if [ $? -ne 0 ]; 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 [ ! -h "${rootdir}/log/steamcmd" ]; then - ln -nfsv "${rootdir}/Steam/logs" "${rootdir}/log/steamcmd" + if [ ! -L "${logdir}/steamcmd" ]; then + echo -en "creating symlink to steam log dir: ${logdir}/steamcmd -> ${rootdir}/Steam/logs..." + ln -nfs "${rootdir}/Steam/logs" "${logdir}/steamcmd" + if [ $? -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi fi fi -sleep 1 -fn_script_log_info "Logs installed" \ No newline at end of file +fn_sleep_time +fn_script_log_info "Logs installed" diff --git a/lgsm/functions/install_minecraft_eula.sh b/lgsm/functions/install_minecraft_eula.sh deleted file mode 100644 index 410e283b4..000000000 --- a/lgsm/functions/install_minecraft_eula.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# LGSM install_minecraft_eula.sh function -# Author: Daniel Gibbs -# Website: https://gameservermanagers.com -# Description: Gets user to accept the EULA. - -echo "" -echo "Accept ${gamename} EULA" -echo "=================================" -sleep 1 -echo "You are required to accept the EULA:" -echo "https://account.mojang.com/documents/minecraft_eula" - -echo "eula=false" > "${filesdir}/eula.txt" - -if [ -z "${autoinstall}" ]; then -echo "By continuing you are indicating your agreement to the EULA." -echo "" - while true; do - read -e -i "y" -p "Continue [Y/n]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) core_exit.sh;; - * ) echo "Please answer yes or no.";; - esac - done -else -echo "By using auto-install you are indicating your agreement to the EULA." -echo "" - sleep 5 -fi - -sed -i "s/eula=false/eula=true/g" "${filesdir}/eula.txt" \ No newline at end of file diff --git a/lgsm/functions/install_mta_resources.sh b/lgsm/functions/install_mta_resources.sh new file mode 100644 index 000000000..b4ff2bece --- /dev/null +++ b/lgsm/functions/install_mta_resources.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# LinuxGSM install_mta_resources.sh function +# Author: Daniel Gibbs +# Contributor: ChaosMTA +# Website: https://linuxgsm.com +# Description: Installs the libmysqlclient for database functions on the server and optionally installs default resources required to run the server + +local commandname="INSTALL" +local commandaction="Install" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_print_information_nl "${gamename} will not function without resources!" +echo " * install default resources using ./${selfname} install-default-resources" +echo " * download resources from https://community.multitheftauto.com" diff --git a/lgsm/functions/install_retry.sh b/lgsm/functions/install_retry.sh index d0ca16fef..e2918c268 100644 --- a/lgsm/functions/install_retry.sh +++ b/lgsm/functions/install_retry.sh @@ -1,18 +1,15 @@ #!/bin/bash -# LGSM install_retry.sh function +# LinuxGSM install_retry.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Asks for installation retry after failure. local commandname="INSTALL" local commandaction="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -while true; do - read -e -i "y" -p "Retry install? [Y/n]" yn - case $yn in - [Yy]* ) command_install.sh; exit;; - [Nn]* ) echo Exiting; exit;; - * ) echo "Please answer yes or no.";; - esac -done \ No newline at end of file +if fn_prompt_yn "Retry install?" Y; then + command_install.sh; exit +else + echo Exiting; exit +fi diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/functions/install_server_dir.sh index d527b6193..18255ebd8 100644 --- a/lgsm/functions/install_server_dir.sh +++ b/lgsm/functions/install_server_dir.sh @@ -1,34 +1,27 @@ #!/bin/bash -# LGSM install_server_dir.sh function +# LinuxGSM install_server_dir.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Creates the server directory. local commandname="INSTALL" local commandaction="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo "" echo "Server Directory" echo "=================================" -sleep 1 -echo "" -pwd -echo "" -if [ -d "${filesdir}" ]; then +fn_sleep_time +if [ -d "${serverfiles}" ]; then fn_print_warning_nl "A server is already installed here." fi +pwd +echo "" if [ -z "${autoinstall}" ]; then - while true; do - read -e -i "y" -p "Continue [Y/n]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) exit;; - * ) echo "Please answer yes or no.";; - esac - done -fi -if [ ! -d "${filesdir}" ]; then - mkdir -v "${filesdir}" + if ! fn_prompt_yn "Continue?" Y; then + exit + fi fi -sleep 1 \ No newline at end of file +if [ ! -d "${serverfiles}" ]; then + mkdir -v "${serverfiles}" +fi \ No newline at end of file diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 04e8e8bdb..0d93f7e6f 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -1,58 +1,76 @@ #!/bin/bash -# LGSM install_server_files.sh function +# LinuxGSM install_server_files.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Installs server files. local commandname="INSTALL" local commandaction="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_server_files(){ - if [ "${gamename}" == "Battlefield: 1942" ]; then - fileurl="http://files.gameservermanagers.com/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full.tar.bz2"; filedir="${tmpdir}"; filename="bf1942_lnxded-1.61-hacked-to-1.612.full.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="a86a5d3cd64ca59abcc9bb9f777c2e5d" - elif [ "${gamename}" == "Call of Duty" ]; then - fileurl="http://files.gameservermanagers.com/CallOfDuty/cod-lnxded-1.5b-full.tar.bz2"; filedir="${tmpdir}"; filename="cod-lnxded-1.5-large.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="19629895a4cf6fd8f6d1ee198b5304cd" - elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then - fileurl="http://files.gameservermanagers.com/CallOfDutyUnitedOffensive/coduo-lnxded-1.51b-full.tar.bz2"; filedir="${tmpdir}"; filename="coduo-lnxded-1.51b-full.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="f1804ef13036e2b4ab535db000b19e97" - elif [ "${gamename}" == "Call of Duty 2" ]; then - fileurl="http://files.gameservermanagers.com/CallOfDuty2/cod2-lnxded-1.3-full.tar.bz2"; filedir="${tmpdir}"; filename="cod2-lnxded-1.3-full.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="078128f83d06dc3d7699428dc2870214" - elif [ "${gamename}" == "Call of Duty: World at War" ]; then - fileurl="http://files.gameservermanagers.com/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.bz2"; filedir="${tmpdir}"; filename="codwaw-lnxded-1.7-full.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="0489697ff3bf678c109bfb377d1b7895" - elif [ "${gamename}" == "GoldenEye: Source" ]; then - fileurl="http://files.gameservermanagers.com/GoldenEyeSource/GoldenEye_Source_v5.0.1_full_server_linux.tar.bz2"; filedir="${tmpdir}"; filename="GoldenEye_Source_v5.0.1_server_full_Linux.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="ea227a150300abe346e757380325f84c" - elif [ "${gamename}" == "Quake 2" ]; then - fileurl="http://files.gameservermanagers.com/Quake2/quake2-3.20-glibc-i386-full-linux2.0.tar.bz2"; filedir="${lgsmdir}/tmp"; filename="quake2-3.20-glibc-i386-full-linux2.0.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="0b8c7e2d51f40b56b328c69e986e7c5f" - elif [ "${gamename}" == "Quake 3: Arena" ]; then - fileurl="http://files.gameservermanagers.com/Quake3/quake3-1.32c-x86-full-linux.tar.bz2"; filedir="${lgsmdir}/tmp"; filename="quake3-1.32c-x86-full-linux.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="fd7258d827474f67663dda297bff4306" + if [ "${shortname}" == "bf1942" ]; then + remote_fileurl="https://files.linuxgsm.com/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full.tar.bz2"; local_filedir="${tmpdir}"; local_filename="bf1942_lnxded-1.61-hacked-to-1.612.full.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="a86a5d3cd64ca59abcc9bb9f777c2e5d" + elif [ "${shortname}" == "bb" ]; then + remote_fileurl="https://files.linuxgsm.com/BrainBread/brainbread-v1.2-linuxserver.tar.bz2"; local_filedir="${tmpdir}"; local_filename="brainbread-v1.2-linuxserver.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="5c729a7e9eecfa81b71a6a1f7267f0fd" + elif [ "${shortname}" == "cod" ]; then + remote_fileurl="https://files.linuxgsm.com/CallOfDuty/cod-lnxded-1.5b-full.tar.bz2"; local_filedir="${tmpdir}"; local_filename="cod-lnxded-1.5-large.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="19629895a4cf6fd8f6d1ee198b5304cd" + elif [ "${shortname}" == "coduo" ]; then + remote_fileurl="https://files.linuxgsm.com/CallOfDutyUnitedOffensive/coduo-lnxded-1.51b-full.tar.bz2"; local_filedir="${tmpdir}"; local_filename="coduo-lnxded-1.51b-full.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="f1804ef13036e2b4ab535db000b19e97" + elif [ "${shortname}" == "cod2" ]; then + remote_fileurl="https://files.linuxgsm.com/CallOfDuty2/cod2-lnxded-1.3-full.tar.bz2"; local_filedir="${tmpdir}"; local_filename="cod2-lnxded-1.3-full.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="078128f83d06dc3d7699428dc2870214" + elif [ "${shortname}" == "cod4" ]; then + remote_fileurl="https://files.linuxgsm.com/CallOfDuty4/cod4x18_1772_dedrun.tar.bz2"; local_filedir="${tmpdir}"; local_filename="cod4x18_1772_dedrun.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="de29f29d79f9cc24574b838daa501e46" + elif [ "${shortname}" == "codwaw" ]; then + remote_fileurl="https://files.linuxgsm.com/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.bz2"; local_filedir="${tmpdir}"; local_filename="codwaw-lnxded-1.7-full.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="0489697ff3bf678c109bfb377d1b7895" + elif [ "${shortname}" == "etl" ]; then + remote_fileurl="https://files.linuxgsm.com/WolfensteinEnemyTerritory/etlegacy-v2.75-i386-et-260b.tar.bz2"; local_filedir="${tmpdir}"; local_filename="etlegacy-v2.75-i386-et-260b.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="92d7d4c26e0a295daed78cef623eeabb" + elif [ "${shortname}" == "ges" ]; then + remote_fileurl="https://files.linuxgsm.com/GoldenEyeSource/GoldenEye_Source_v5.0.6_full_server.tar.bz2"; local_filedir="${tmpdir}"; local_filename="GoldenEye_Source_v5.0.6_full_server.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="c45c16293096706e8b5e2cd64a6f2931" + elif [ "${shortname}" == "ns" ]; then + remote_fileurl="https://files.linuxgsm.com/NaturalSelection/ns_dedicated_server_v32.tar.bz2"; local_filedir="${tmpdir}"; local_filename="ns_dedicated_server_v32.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="499cf63324b76925ada6baf5f2eacd67" + elif [ "${shortname}" == "q2" ]; then + remote_fileurl="https://files.linuxgsm.com/Quake2/quake2-3.20-glibc-i386-full-linux2.0.tar.bz2"; local_filedir="${tmpdir}"; local_filename="quake2-3.20-glibc-i386-full-linux2.0.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="0b8c7e2d51f40b56b328c69e986e7c5f" + elif [ "${shortname}" == "q3" ]; then + remote_fileurl="https://files.linuxgsm.com/Quake3/quake3-1.32c-x86-full-linux.tar.bz2"; local_filedir="${tmpdir}"; local_filename="quake3-1.32c-x86-full-linux.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="fd7258d827474f67663dda297bff4306" + elif [ "${shortname}" == "qw" ]; then + remote_fileurl="https://files.linuxgsm.com/QuakeWorld/nquake.server.linux.190506.full.tar.bz2"; local_filedir="${tmpdir}"; local_filename="nquake.server.linux.190506.full.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="74405ec030463c5e1175e776ab572d32" + elif [ "${shortname}" == "rtcw" ]; then + remote_fileurl="https://files.linuxgsm.com/ReturnToCastleWolfenstein/iortcw-1.51c-x86_64-server-linux-20190507.tar.bz2"; local_filedir="${tmpdir}"; local_filename="iortcw-1.51c-x86_64-server-linux-20190507.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="6a3be9700372b228d1187422464e4212" + elif [ "${shortname}" == "sof2" ]; then + remote_fileurl="https://files.linuxgsm.com/SoldierOfFortune2/sof2gold-1.03.tar.bz2"; local_filedir="${tmpdir}"; local_filename="sof2gold-1.03.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="871b1dc0dafeeace65b198119e8fa200" + elif [ "${shortname}" == "ut2k4" ]; then + remote_fileurl="https://files.linuxgsm.com/UnrealTournament2004/ut2004-server-3369-2-ultimate-linux.tar.bz2"; local_filedir="${tmpdir}"; local_filename="ut2004-server-3369-2-ultimate-linux.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="67c5e2cd9c2a4b04f163962ee41eff54" + elif [ "${shortname}" == "ut99" ]; then + remote_fileurl="https://files.linuxgsm.com/UnrealTournament99/ut99-server-451-ultimate-linux.tar.bz2"; local_filedir="${tmpdir}"; local_filename="ut99-server-451-ultimate-linux.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="49cb24d0550ff6ddeaba6007045c6edd" + elif [ "${shortname}" == "ut" ]; then + remote_fileurl="https://s3.amazonaws.com/unrealtournament/UnrealTournament-Client-XAN-3395761-Linux.zip"; local_filedir="${tmpdir}"; local_filename="UnrealTournament-Server-XAN-3395761-Linux.zip"; chmodx="noexecute" run="norun"; force="noforce"; md5="f04ad5b96865b19613303331ff4075eb" + elif [ "${shortname}" == "ut3" ]; then + remote_fileurl="https://files.linuxgsm.com/UnrealTournament3/UT3-linux-server-2.1.tar.bz2"; local_filedir="${tmpdir}"; local_filename="UT3-linux-server-2.1.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="2527437b46f1b47f20228d27d72395a6" + elif [ "${shortname}" == "vs" ]; then + remote_fileurl="https://files.linuxgsm.com/VampireSlayer/vs_l-6.0_full.tar.bz2"; local_filedir="${tmpdir}"; local_filename="vs_l-6.0_full.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="38a79e44b98578bbdc5b15818493a066" + elif [ "${shortname}" == "wet" ]; then + remote_fileurl="https://files.linuxgsm.com/WolfensteinEnemyTerritory/enemy-territory.260b.tar.bz2"; local_filedir="${tmpdir}"; local_filename="enemy-territory.260b.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="f833f514bfcdd46b42c111f83350c5a7" + elif [ "${shortname}" == "samp" ]; then + remote_fileurl="https://files.sa-mp.com/samp037svr_R2-1.tar.gz"; local_filedir="${tmpdir}"; local_filename="samp037svr_R2-1.tar.gz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="93705e165550c97484678236749198a4" elif [ "${gamename}" == "Jedi Knight II: Jedi Outcast" ]; then fileurl="http://www.nateberkopec.com/jk2.tar.bz2"; filedir="${lgsmdir}/tmp"; filename="jk2.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="605081820bc570e6424858aa165f790c" - elif [ "${gamename}" == "Unreal Tournament 2004" ]; then - fileurl="http://files.gameservermanagers.com/UnrealTournament2004/ut2004-server-3339-ultimate-linux.tar.bz2"; filedir="${tmpdir}"; filename="ut2004-server-3339-ultimate-linux.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="67c5e2cd9c2a4b04f163962ee41eff54" - elif [ "${gamename}" == "Unreal Tournament 99" ]; then - fileurl="http://files.gameservermanagers.com/UnrealTournament99/ut99-server-451-ultimate-linux.tar.bz2"; filedir="${tmpdir}"; filename="ut99-server-451-ultimate-linux.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="49cb24d0550ff6ddeaba6007045c6edd" - elif [ "${gamename}" == "Unreal Tournament" ]; then - fileurl="http://files.gameservermanagers.com/UnrealTournament/UnrealTournament-Server-XAN-3045522-Linux.zip"; filedir="${tmpdir}"; filename="UnrealTournament-Server-XAN-3045522-Linux.zip"; executecmd="noexecute" run="norun"; force="noforce"; md5="553fed5645a9fc623e92563049bf79f6" - elif [ "${gamename}" == "Unreal Tournament 3" ]; then - fileurl="http://files.gameservermanagers.com/UnrealTournament3/UT3-linux-server-2.1.tar.bz2"; filedir="${tmpdir}"; filename="UT3-linux-server-2.1.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="2527437b46f1b47f20228d27d72395a6" - elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then - fileurl="http://files.gameservermanagers.com/WolfensteinEnemyTerritory/enemy-territory.260b.tar.bz2"; filedir="${tmpdir}"; filename="enemy-territory.260b.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="f833f514bfcdd46b42c111f83350c5a7" fi - fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}" - fn_dl_extract "${filedir}" "${filename}" "${filesdir}" + fn_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" + fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}" } fn_install_server_files_steamcmd(){ counter="0" while [ "${counter}" == "0" ]||[ "${exitcode}" != "0" ]; do counter=$((counter+1)) - cd "${rootdir}/steamcmd" + cd "${steamcmddir}" if [ "${counter}" -le "10" ]; then - # Attempt 1-4: Standard attempt - # Attempt 5-6: Validate attempt - # Attempt 7-8: Validate, delete long name dir - # Attempt 9-10: Validate, delete long name dir, re-download SteamCMD - # Attempt 11: Failure + # Attempt 1-4: Standard attempt. + # Attempt 5-6: Validate attempt. + # Attempt 7-8: Validate, delete long name dir. + # Attempt 9-10: Validate, delete long name dir, re-download SteamCMD. + # Attempt 11: Failure. if [ "${counter}" -ge "2" ]; then fn_print_warning_nl "SteamCMD did not complete the download, retrying: Attempt ${counter}" @@ -60,40 +78,40 @@ fn_install_server_files_steamcmd(){ 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 + echo "Removing $(find "${serverfiles}" -type d -print0 | grep -Ez '[^/]{30}$')" + find "${serverfiles}" -type d -print0 | grep -Ez '[^/]{30}$' | xargs -0 rm -rf fi if [ "${counter}" -ge "9" ]; then - rm -rf "${rootdir}/steamcmd" + rm -rf "${steamcmddir}" check_steamcmd.sh fi # Detects if unbuffer command is available for 32 bit distributions only. info_distro.sh - if [ $(command -v stdbuf) ]&&[ "${arch}" != "x86_64" ]; then + if [ "$(command -v stdbuf 2>/dev/null)" ]&&[ "${arch}" != "x86_64" ]; then unbuffer="stdbuf -i0 -o0 -e0" 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}" ${branch} +quit + if [ "${appid}" == "90" ]; then + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit local exitcode=$? - elif [ "${gamename}" == "Jedi Knight II: Jedi Outcast" ]; then - ${unbuffer} ./steamcmd.sh +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} +quit + elif [ "${shortname}" == "unt" ]; then + ${unbuffer} ./steamcmd.sh +@sSteamCmdForcePlatformBitness 32 +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} validate +quit local exitcode=$? else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} +quit local exitcode=$? 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}" ${branch} -validate +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} validate +quit local exitcode=$? elif [ "${gamename}" == "Jedi Knight II: Jedi Outcast" ]; then ${unbuffer} ./steamcmd.sh +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} -validate +quit local exitcode=$? else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} -validate +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} validate +quit local exitcode=$? fi fi @@ -111,7 +129,7 @@ fn_install_server_files_steamcmd(){ 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}" ${branch} -validate +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" ${branch} validate +quit local exitcode=$? done fi @@ -120,32 +138,35 @@ fn_install_server_files_steamcmd(){ echo "" echo "Installing ${gamename} Server" echo "=================================" -sleep 1 +fn_sleep_time if [ -n "${appid}" ]; then fn_install_server_files_steamcmd fi -if [ "${gamename}" == "TeamSpeak 3" ]; then +if [ "${shortname}" == "ts3" ]; then update_ts3.sh -elif [ "${gamename}" == "Minecraft" ]; then +elif [ "${shortname}" == "mc" ]; then + install_eula.sh update_minecraft.sh - install_minecraft_eula.sh -elif [ "${gamename}" == "Mumble" ]; then +elif [ "${shortname}" == "mumble" ]; then update_mumble.sh -elif [ -z "${appid}" ]||[ "${gamename}" == "GoldenEye: Source" ]; then +elif [ "${shortname}" == "mta" ]; then + update_mta.sh +elif [ "${shortname}" == "fctr" ]; then + update_factorio.sh + install_factorio_save.sh +elif [ -z "${appid}" ]||[ "${shortname}" == "ges" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "vs" ]; then + if [ "${shortname}" == "ut" ]; then + install_eula.sh + fi fn_install_server_files fi 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]* ) install_retry.sh;; - * ) echo "Please answer yes or no.";; - esac - done + 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 100644 index 000000000..f9cf40835 --- /dev/null +++ b/lgsm/functions/install_squad_license.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# LinuxGSM install_squad_license.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Configures the Squad server's license. + +local commandname="INSTALL" +local commandaction="Install" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo "" +echo "Squad Server License" +echo "=================================" +fn_sleep_time +echo "Server license is an optional feature for ${gamename} server" +fn_script_log_info "Server license is an optional feature for ${gamename} server" + +echo "Get more info and a server license here:" +echo "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +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 "" +fn_sleep_time +echo "The Squad server license can be changed by editing ${servercfgdir}/License.cfg." +fn_script_log_info "The Squad server license can be changed by editing ${selfname}." +echo "" \ No newline at end of file diff --git a/lgsm/functions/install_steamcmd.sh b/lgsm/functions/install_steamcmd.sh index 82cce59a6..4b24c4274 100644 --- a/lgsm/functions/install_steamcmd.sh +++ b/lgsm/functions/install_steamcmd.sh @@ -1,7 +1,7 @@ #!/bin/bash -# LGSM install_steamcmd.sh function +# LinuxGSM install_steamcmd.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Downloads SteamCMD on install. local commandname="INSTALL" @@ -10,5 +10,5 @@ local commandaction="Install" echo "" echo "Installing SteamCMD" echo "=================================" -sleep 1 +fn_sleep_time check_steamcmd.sh diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh index bada12c0b..6fbe45724 100644 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/functions/install_ts3db.sh @@ -1,73 +1,76 @@ #!/bin/bash -# LGSM install_ts3db.sh function +# LinuxGSM install_ts3db.sh function # Author: Daniel Gibbs # Contributor: PhilPhonic -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Installs the database server MariaDB for TeamSpeak 3. local commandname="INSTALL" local commandaction="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_ts3db_mariadb(){ - echo "" - echo "checking if libmariadb2 is installed" - echo "=================================" - sleep 1 - ldd ${filesdir}/libts3db_mariadb.so | grep "libmariadb.so.2 => not found" - if [ $? -eq 0 ]; then - echo "libmariadb2 not installed. Please install it first." - echo "exiting..." - exit - else - echo "libmariadb2 installed." + 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 "" - echo "Configuring ${gamename} Server for MariaDB/MySQL" + echo "Configure ${gamename} Server for MariaDB" echo "=================================" - sleep 1 - read -p "Enter MariaDB hostname: " mariahostname - read -p "Enter MariaDB port: " mariaport - read -p "Enter MariaDB username: " mariausername - read -p "Enter MariaDB password: " mariapassword - read -p "Enter MariaDB database name: " mariadbname - echo "updating config." - echo "[config]" >> ${servercfgdir}/ts3db_mariadb.ini - echo "host='${mariahostname}'" >> ${servercfgdir}/ts3db_mariadb.ini - echo "port='${mariaport}'" >> ${servercfgdir}/ts3db_mariadb.ini - echo "username='${mariausername}'" >> ${servercfgdir}/ts3db_mariadb.ini - echo "password='${mariapassword}'" >> ${servercfgdir}/ts3db_mariadb.ini - echo "database='${mariadbname}'" >> ${servercfgdir}/ts3db_mariadb.ini - echo "socket=" >> ${servercfgdir}/ts3db_mariadb.ini + 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 "[config]" + echo "host='${mariahostname}'" + echo "port='${mariaport}'" + echo "username='${mariausername}'" + echo "password='${mariapassword}'" + echo "database='${mariadbname}'" + echo "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 "=================================" - sleep 1 + echo "updating ts3db_mariadb.ini." + fn_sleep_time } +echo "" +echo "Select Database" +echo "=================================" +fn_sleep_time if [ -z "${autoinstall}" ]; then - echo "" - while true; do - read -e -i "n" -p "Do you want to use MariaDB/MySQL instead of sqlite (Database Server including user and database already has to be set up!)? [y/N]" yn - case $yn in - [Yy]* ) fn_install_ts3db_mariadb && break;; - [Nn]* ) break;; - * ) echo "Please answer yes or no.";; - esac - done + 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_warning_nl "./${selfname} auto-install is uses sqlite. For MariaDB/MySQL use ./${selfname} install" +fn_print_information_nl "./${selfname} auto-install is uses sqlite. For MariaDB use ./${selfname} install" fi -## Get privilege key +install_eula.sh + echo "" echo "Getting privilege key" echo "=================================" -sleep 1 -echo "IMPORANT! Save these details for later." -sleep 1 -cd "${executabledir}" -./ts3server_startscript.sh start inifile=ts3-server.ini +fn_sleep_time +fn_print_information_nl "Save these details for later." +cd "${executabledir}" || exit +${executable} start inifile=ts3-server.ini sleep 5 -./ts3server_startscript.sh stop +${executable} stop diff --git a/lgsm/functions/install_ut2k4_key.sh b/lgsm/functions/install_ut2k4_key.sh index b091faff3..0f0fe6da5 100644 --- a/lgsm/functions/install_ut2k4_key.sh +++ b/lgsm/functions/install_ut2k4_key.sh @@ -1,17 +1,17 @@ #!/bin/bash -# LGSM install_ut2k4_key.sh function +# LinuxGSM install_ut2k4_key.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Activates ut2k4 server with given key. local commandname="INSTALL" local commandaction="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo "" echo "Enter ${gamename} CD Key" echo "=================================" -sleep 1 +fn_sleep_time echo "To get your server listed on the Master Server list" echo "you must get a free CD key. Get a key here:" echo "https://forums.unrealtournament.com/utserver/cdkey.php?2004" @@ -19,7 +19,7 @@ echo "" if [ -z "${autoinstall}" ]; then echo "Once you have the key enter it below" echo -n "KEY: " - read CODE + read -r CODE echo ""\""CDKey"\""="\""${CODE}"\""" > "${systemdir}/cdkey" if [ -f "${systemdir}/cdkey" ]; then fn_script_log_info "UT2K4 Server CD Key created" diff --git a/lgsm/functions/logs.sh b/lgsm/functions/logs.sh index 32ad0deae..c4de5e8c8 100644 --- a/lgsm/functions/logs.sh +++ b/lgsm/functions/logs.sh @@ -1,33 +1,34 @@ #!/bin/bash -# LGSM logs.sh function +# LinuxGSM logs.sh function # Author: Daniel Gibbs # Contributor: UltimateByte -# Website: https://gameservermanagers.com -# Description: Acts as a log rotater, removing old logs. +# Website: https://linuxgsm.com +# Description: Acts as a log rotator, removing old logs. local commandname="LOGS" local commandaction="Log-Manager" -# Check if logfile variable and file exist, create logfile if it doesn't exist +# Check if logfile variable and file exist, create logfile if it doesn't exist. if [ -n "${consolelog}" ]; then if [ ! -e "${consolelog}" ]; then touch "${consolelog}" fi fi -# For games not displaying a console, and having logs into their game directory -if [ "${function_selfname}" == "command_start.sh" ] && [ -n "${gamelogfile}" ]; then +# For games not displaying a console, and having logs into their game directory. +check_status.sh +if [ "${status}" != "0" ]&&[ "${function_selfname}" == "command_start.sh" ]&&[ -n "${gamelogfile}" ]; then if [ -n "$(find "${systemdir}" -name "gamelog*.log")" ]; then fn_print_info "Moving game logs to ${gamelogdir}" fn_script_log_info "Moving game logs to ${gamelogdir}" echo -en "\n" - sleep 1 + 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 "${scriptlogdir}"/ -type f -mtime +"${logdays}"|wc -l) -ne "0" ]; then +# Log manager will start the cleanup if it finds logs older than "${logdays}". +if [ $(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l) -ne "0" ]; then fn_print_dots "Starting" # Set common logs directories commonlogs="${systemdir}/logs" @@ -36,79 +37,69 @@ if [ $(find "${scriptlogdir}"/ -type f -mtime +"${logdays}"|wc -l) -ne "0" ]; th sourcemodlogdir="${systemdir}/addons/sourcemod/logs" ulxlogdir="${systemdir}/data/ulx_logs" darkrplogdir="${systemdir}/data/darkrp_logs" - legacyserverlogdir="${rootdir}/log/server" + legacyserverlogdir="${logdir}/server" # Setting up counting variables scriptcount="0" ; consolecount="0" ; gamecount="0" ; srcdscount="0" ; smcount="0" ; ulxcount="0" ; darkrpcount="0" ; legacycount="0" - sleep 1 + fn_sleep_time fn_print_ok_nl "Starting" - fn_print_info_nl "Removing logs older than "${logdays}" days" - fn_script_log_info "Removing logs older than "${logdays}" days" - # Logging logfiles to be removed according to "${logdays}", counting and removing them - # Script logfiles - find "${scriptlogdir}"/ -type f -mtime +"${logdays}"| tee >> "${scriptlog}" - scriptcount=$(find "${scriptlogdir}"/ -type f -mtime +"${logdays}"|wc -l) - find "${scriptlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; - # SRCDS and unreal logfiles + fn_print_info_nl "Removing logs older than ${logdays} days" + fn_script_log_info "Removing logs older than ${logdays} days" + # Logging logfiles to be removed according to "${logdays}", counting and removing them. + # Script logfiles. + 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 >> "${scriptlog}" - gamecount=$(find "${gamelogdir}"/ -type f -mtime +"${logdays}"|wc -l) + find "${gamelogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + gamecount=$(find "${gamelogdir}"/ -type f -mtime +"${logdays}" | wc -l) find "${gamelogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; fi - # Console logfiles + # Console logfiles. if [ -n "${consolelog}" ]; then - find "${consolelogdir}"/ -type f -mtime +"${logdays}"| tee >> "${scriptlog}" - consolecount=$(find "${consolelogdir}"/ -type f -mtime +"${logdays}"|wc -l) + 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 >> "${scriptlog}" - smcount=$(find "${commonlogs}"/ -type f -mtime +"${logdays}"|wc -l) + # 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 >> "${scriptlog}" - smcount=$(find "${commonsourcelogs}"/* -type f -mtime +"${logdays}"|wc -l) + 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 + # Source addons logfiles. if [ "${engine}" == "source" ]; then - # SourceMod logfiles + # SourceMod logfiles. if [ -d "${sourcemodlogdir}" ]; then - find "${sourcemodlogdir}"/ -type f -mtime +"${logdays}"| tee >> "${scriptlog}" - smcount=$(find "${sourcemodlogdir}"/ -type f -mtime +"${logdays}"|wc -l) + 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 + # Garry's Mod logfiles. if [ "${gamename}" == "Garry's Mod" ]; then - # ULX logfiles + # ULX logfiles. if [ -d "${ulxlogdir}" ]; then - find "${ulxlogdir}"/ -type f -mtime +"${logdays}"| tee >> "${scriptlog}" - ulxcount=$(find "${ulxlogdir}"/ -type f -mtime +"${logdays}"|wc -l) + find "${ulxlogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + ulxcount=$(find "${ulxlogdir}"/ -type f -mtime +"${logdays}" | wc -l) find "${ulxlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; fi - # DarkRP logfiles + # DarkRP logfiles. if [ -d "${darkrplogdir}" ]; then - find "${darkrplogdir}"/ -type f -mtime +"${logdays}"| tee >> "${scriptlog}" - darkrpcount=$(find "${darkrplogdir}"/ -type f -mtime +"${logdays}"|wc -l) + 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 - # Legacy support - if [ -d "${legacyserverlogdir}" ]; then - find "${legacyserverlogdir}"/ -type f -mtime +"${logdays}"| tee >> "${scriptlog}" - legacycount=$(find "${legacyserverlogdir}"/ -type f -mtime +"${logdays}"|wc -l) - find "${legacyserverlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; - # Remove directory if empty - if [ ! "$(ls -A "${legacyserverlogdir}")" ]; then - rm -rf "${legacyserverlogdir}" - fi - fi - # Count total amount of files removed - count=$((${scriptcount} + ${consolecount} + ${gamecount} + ${srcdscount} + ${smcount} + ${ulxcount} + ${darkrpcount} + ${legacycount})) - # Job done - fn_print_ok_nl "Removed ${count} log files" - fn_script_log "Removed ${count} log files" + # Count total amount of files removed. + countlogs=$((${scriptcount} + ${consolecount} + ${gamecount} + ${srcdscount} + ${smcount} + ${ulxcount} + ${darkrpcount})) + # Job done. + fn_print_ok_nl "Removed ${countlogs} log files" + fn_script_log "Removed ${countlogs} log files" fi diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh new file mode 100644 index 000000000..30e436a53 --- /dev/null +++ b/lgsm/functions/mods_core.sh @@ -0,0 +1,467 @@ +#!/bin/bash +# LinuxGSM command_mods_install.sh function +# Author: Daniel Gibbs +# Contributor: UltimateByte +# Website: https://linuxgsm.com +# Description: Core functions for mods list/install/update/remove + +local commandname="MODS" +local commandaction="Mods" +local function_selfname="$(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 'A-Z' 'a-z') + if [ "${src}" != "${dst}" ] + then + [ ! -e "${dst}" ] && mv -T "${src}" "${dst}" || echo "${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} -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + fn_sleep_time + 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} -ne 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 + fn_sleep_time +} + +# 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} -ne 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 [ ! -n "$(sed -n "/^${modcommand}$/p" "${modsinstalledlistfullpath}")" ]; then + echo "${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 "${removefromlist}" | awk -F ';' '{ print NF }')" + # Test all subvalue of "removefromlist" using the ";" separator. + for ((filesindex=1; filesindex < removefromlistamount; filesindex++)); do + # Put current file into test variable. + removefilevar="$(echo "${removefromlist}" | awk -F ';' -v x=${filesindex} '{ print $x }')" + # Delete line(s) matching exactly. + sed -i "/^${removefilevar}$/d" "${modsdir}/${modcommand}-files.txt" + # Exit on error. + local exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Error while tidying line: ${removefilevar} from: ${modsdir}/${modcommand}-files.txt" + 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 +} + +## 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 "* 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 [ -n "${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 "${modgames}" | awk -F ';' '{ print NF }')" + # Test all subvalue of "modgames" using the ";" separator. + for ((gamevarindex=1; gamevarindex < gamesamount; gamevarindex++)); do + # Put current game name into modtest variable. + gamemodtest="$( echo "${modgames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' )" + # If game name matches. + 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 "${modengines}" | awk -F ';' '{ print NF }')" + # Test all subvalue of "modengines" using the ";" separator. + for ((gamevarindex=1; gamevarindex < ${enginesamount}; gamevarindex++)); do + # Put current engine name into modtest variable. + enginemodtest="$( echo "${modengines}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' )" + # If engine name matches. + 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 "${modexcludegames}" | awk -F ';' '{ print NF }')" + # Test all subvalue of "modexcludegames" using the ";" separator. + for ((gamevarindex=1; gamevarindex < excludegamesamount; gamevarindex++)); do + # Put current engine name into modtest variable. + excludegamemodtest="$( echo "${modexcludegames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' )" + # If engine name matches. + 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} -ne 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 + fn_sleep_time + fi + # Create mod install directory. + if [ ! -d "${modinstalldir}" ]; then + echo -en "creating mods install directory ${modinstalldir}..." + mkdir -p "${modinstalldir}" + exitcode=$? + if [ ${exitcode} -ne 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 + fn_sleep_time + 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} -ne 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 -r "${modstmpdir}" + exitcode=$? + if [ ${exitcode} -ne 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 "${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 "" + fn_print_failure_nl "No installed mods or addons were found" + echo " * 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 "* 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 +} + +## 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 100644 index 000000000..eb1e2f8bf --- /dev/null +++ b/lgsm/functions/mods_list.sh @@ -0,0 +1,88 @@ +#!/bin/bash +# LinuxGSM mods_list.sh function +# Author: Daniel Gibbs +# Contributor: UltimateByte +# Website: https://linuxgsm.com +# Description: Lists and defines available mods for LinuxGSM supported servers; works along with mods_core.sh. +# Usage: To add a mod, you need to add an array variable following the guide to set proper values; +# Usage: Then add this array to the mods_global_array. +# Usage: If needed, you can scrape the download URL first. + +local commandname="MODS" +local commandaction="List Mods" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Get a proper URL for mods that don't provide a good one (optional) +fn_script_log_info "Retrieving latest mods URLs" +# Metamod +metamodmversion="1.10" +metamodscrapeurl="https://mms.alliedmods.net/mmsdrop/${metamodmversion}/mmsource-latest-linux" +metamodlatestfile="$(wget "${metamodscrapeurl}" -q -O -)" +metamoddownloadurl="https://www.metamodsource.net/latest.php?os=linux&version=${metamodmversion}" +metamodurl="${metamoddownloadurl}" +# Sourcemod +sourcemodmversion="1.9" +sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodmversion}/sourcemod-latest-linux" +sourcemodlatestfile="$(wget "${sourcemodscrapeurl}" -q -O -)" +sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${sourcemodmversion}" +sourcemodurl="${sourcemoddownloadurl}" +# Oxide +oxiderustlatestlink="$(curl -sL https://api.github.com/repos/theumod/umod.rust/releases/latest | grep browser_download_url | cut -d '"' -f 4)" +oxidehurtworldlatestlink="$(curl -sL https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep "Oxide.Hurtworld.zip")" +oxidesdtdlatestlink="$(curl -sL https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | grep browser_download_url | cut -d '"' -f 4)" + +# Define mods information (required) + +# Separator name +modseparator="MOD" + +# REQUIRED: mod_info_name=( MOD "modcommand" "Pretty Name" "URL" "filename" "modsubdirs" "LowercaseOn/Off" "/files/to/keep;" "/install/path" "ENGINES" "GAMES" "NOTGAMES" "AUTHOR_URL" "Short Description" ) +# Example 1) Well made mod: mod_info_name=( MOD "awesomemod" "This is an Awesome Mod" "https://awesomemod.com/latest.zip" "awesomemod.zip" "0" "LowercaseOff" "OVERWRITE" "${systemdir}/addons" "source;unity3d;" "GAMES" "NOTGAMES" "https://awesomemod.com/" "This mod knows that 42 is the answer" ) +# Example 2) Poorly made mod: mod_info_name=( MOD "stupidmod" "This is a stupid mod" "${crappymodurl}" "StupidMod.zip" "2" "LowercaseOn" "cfg;data/crappymod;" "${systemdir}" "source;" "GAMES" "Garry's mod;Counter-Strike: Source;" "This mod is dumber than dumb" ) +# None of those values can be empty +# index | Usage +# [0] | MOD: separator, all mods must begin with it +# [1] | "modcommand": the LGSM name and command to install the mod (must be unique and lowercase) +# [2] | "Pretty Name": the common name people use to call the mod that will be displayed to the user +# [3] | "URL": link to the mod archive file; can be a variable previously defined while scraping a URL +# [4] | "filename": the output filename +# [5] | "modsubdirs": in how many subdirectories is the mod (none is 0) (not used at release, but could be in the future) +# [6] | "LowercaseOn/Off": LowercaseOff or LowercaseOn: enable/disable converting extracted files and directories to lowercase (some games require it) +# [7] | "modinstalldir": the directory in which to install the mode (use LGSM dir variables such as ${systemdir}) +# [8] | "/files/to/keep;", files & directories that should not be overwritten upon update, separated and ended with a semicolon; you can also use "OVERWRITE" value to ignore the value or "NOUPDATE" to disallow updating; for files to keep upon uninstall, see fn_mod_tidy_files_list from mods_core.sh +# [9] | "Supported Engines;": list them according to LGSM ${engine} variables, separated and ended with a semicolon, or use ENGINES to ignore the value +# [10] | "Supported Games;": list them according to LGSM ${gamename} variables, separated and ended with a semicolon, or use GAMES to ignore the value +# [11] | "Unsupported Games;": list them according to LGSM ${gamename} variables, separated and ended with a semicolon, or use NOTGAMES to ignore the value (useful to exclude a game when using Supported Engines) +# [12] | "AUTHOR_URL" is the author's website, displayed to the user when chosing mods to install +# [13] | "Short Description" a description showed to the user upon installation/removal + +# Source mods +mod_info_metamod=( MOD "metamod" "MetaMod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework" ) +mod_info_sourcemod=( MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires MetaMod)" ) + +# CS:GO Mods +mod_info_gokz=( MOD "gokz" "GOKZ" "https://bitbucket.org/kztimerglobalteam/gokz/downloads/GOKZ-latest.zip" "gokz-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter Strike: Global Offensive" "NOTGAMES" "https://bitbucket.org/kztimerglobalteam/gokz/src/master/" "Implements the KZ game mode (requires SourceMod and MetaMod)") +mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodmversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter Strike: Global Offensive" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)") + +# 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.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-rust.1659/" "Allows for the use of plugins" ) +mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestlink}" "Oxide.Hurtworld.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Hurtworld;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-hurtworld.1332/" "Allows for the use of plugins" ) +mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-7-days-to-die.813/" "Allows for the use of plugins" ) + +# REQUIRED: Set all mods info into the global array +mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_sourcemod[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" ) diff --git a/lgsm/functions/monitor_gsquery.sh b/lgsm/functions/monitor_gsquery.sh deleted file mode 100644 index 2c8b2902b..000000000 --- a/lgsm/functions/monitor_gsquery.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -# LGSM monitor_gsquery.sh function -# Author: Daniel Gibbs -# Website: https://gameservermanagers.com -# Description: Uses gsquery.py to query the server port. -# Detects if the server has frozen with the process still running. - -local commandname="MONITOR" -local commandaction="Monitor" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" - -# Forces legacy servers to use gsquery -if [ -z "${gsquery}" ]; then - gsquery="yes" -fi - -if [ "${gsquery}" == "yes" ]; then - - # Downloads gsquery.py if missing - if [ ! -f "${functionsdir}/gsquery.py" ]; then - fn_fetch_file_github "lgsm/functions" "gsquery.py" "${functionsdir}" "executecmd" "norun" "noforce" "nomd5" - fi - - info_config.sh - - if [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then - port=$((port + 1)) - elif [ "${engine}" == "realvirtuality" ]; then - port=$((port + 1)) - elif [ "${engine}" == "spark" ]; then - port=$((port + 1)) - elif [ "${engine}" == "idtech3_ql" ]; then - engine="quakelive" - fi - - if [ -n "${queryport}" ]; then - port="${queryport}" - fi - - fn_print_info "Querying port: gsquery.py enabled" - fn_script_log_info "Querying port: gsquery.py enabled" - sleep 1 - - # Will query up to 4 times every 15 seconds. - # Servers changing map can return a failure. - # Will Wait up to 60 seconds to confirm server is down giving server time to change map. - totalseconds=0 - for queryattempt in {1..5}; do - fn_print_dots "Querying port: ${ip}:${port} : ${totalseconds}/${queryattempt} : " - fn_print_querying_eol - fn_script_log_info "Querying port: ${ip}:${port} : ${queryattempt} : QUERYING" - - gsquerycmd=$("${functionsdir}"/gsquery.py -a "${ip}" -p "${port}" -e "${engine}" 2>&1) - exitcode=$? - - sleep 1 - if [ "${exitcode}" == "0" ]; then - # Server OK - fn_print_ok "Querying port: ${ip}:${port} : ${queryattempt} : " - fn_print_ok_eol_nl - fn_script_log_pass "Querying port: ${ip}:${port} : ${queryattempt} : OK" - exitcode=0 - break - else - # Server failed query - fn_script_log_info "Querying port: ${ip}:${port} : ${queryattempt} : ${gsquerycmd}" - - if [ "${queryattempt}" == "5" ]; then - # Server failed query 4 times confirmed failure - fn_print_fail "Querying port: ${ip}:${port} : ${totalseconds}/${queryattempt} : " - fn_print_fail_eol_nl - fn_script_log_error "Querying port: ${ip}:${port} : ${queryattempt} : FAIL" - sleep 1 - - # Send alert if enabled - alert="restartquery" - alert.sh - command_restart.sh - break - fi - - # Seconds counter - for seconds in {1..15}; do - fn_print_fail "Querying port: ${ip}:${port} : ${totalseconds}/${queryattempt} : ${red}${gsquerycmd}${default}" - totalseconds=$((totalseconds + 1)) - sleep 1 - if [ "${seconds}" == "15" ]; then - break - fi - done - fi - done -fi -core_exit.sh \ No newline at end of file diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh new file mode 100644 index 000000000..2c6192030 --- /dev/null +++ b/lgsm/functions/query_gamedig.sh @@ -0,0 +1,133 @@ +#!/bin/bash +# query_gamedig.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Querys a gameserver using node-gamedig. +# https://github.com/sonicsnes/node-gamedig + +# Check if gamedig and jq are installed. +if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; then + + if [ "${engine}" == "idtech3_ql" ]; then + local engine="quakelive" + elif [ "${gamename}" == "Killing Floor 2" ]; then + local engine="unreal4" + fi + + local engine_query_array=( avalanche3.0 madness quakelive realvirtuality refractor source goldsource spark starbound unity3d unreal4 wurm ) + for engine_query in "${engine_query_array[@]}" + do + if [ "${engine_query}" == "${engine}" ]; then + gamedigengine="protocol-valve" + fi + done + + local engine_query_array=( avalanche2.0 ) + for engine_query in "${engine_query_array[@]}" + do + if [ "${engine_query}" == "${engine}" ]; then + gamedigengine="jc2mp" + fi + done + + local engine_query_array=( quake ) + for engine_query in "${engine_query_array[@]}" + do + if [ "${engine_query}" == "${engine}" ]; then + gamedigengine="protocol-quake1" + fi + done + + local engine_query_array=( idtech2 iw2.0 ) + for engine_query in "${engine_query_array[@]}" + do + if [ "${engine_query}" == "${engine}" ]; then + gamedigengine="protocol-quake2" + fi + done + + local engine_query_array=( idtech3 iw3.0 ioquake3 ) + for engine_query in "${engine_query_array[@]}" + do + if [ "${engine_query}" == "${engine}" ]; then + gamedigengine="protocol-quake3" + fi + done + + local engine_query_array=( lwjgl2 ) + for engine_query in "${engine_query_array[@]}" + do + if [ "${engine_query}" == "${engine}" ]; then + gamedigengine="minecraft" + fi + done + + local shortname_query_array=( ts3 ) + for shortname_query in "${shortname_query_array[@]}" + do + if [ "${shortname_query}" == "${shortname}" ]; then + gamedigengine="teamspeak3" + fi + done + + local engine_query_array=( unreal ) + for engine_query in "${engine_query_array[@]}" + do + if [ "${engine_query}" == "${engine}" ]; then + gamedigengine="ut" + fi + done + + # will bypass query if server offline. + check_status.sh + if [ "${status}" != "0" ]; then + # checks if query is working null = pass. + gamedigcmd=$(echo "gamedig --type \"${gamedigengine}\" --host \"${ip}\" --query_port \"${queryport}\"|jq") + gamedigraw=$(gamedig --type "${gamedigengine}" --host "${ip}" --query_port "${queryport}") + querystatus=$(echo "${gamedigraw}" | jq '.error|length') + + if [ "${querystatus}" != "null" ]; then + gamedigcmd=$(echo "gamedig --type \"${gamedigengine}\" --host \"${ip}\" --port \"${queryport}\"|jq") + gamedigraw=$(gamedig --type "${gamedigengine}" --host "${ip}" --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. + gdplayers=$(echo "${gamedigraw}" | jq -re '.players|length') + if [ "${gdplayers}" == "null" ]; then + unset gdplayers + fi + + # maxplayers. + gdmaxplayers=$(echo "${gamedigraw}" | jq -re '.maxplayers|length') + if [ "${gdmaxplayers}" == "null" ]; then + unset maxplayers + 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 '.raw.numbots') + if [ "${gdbots}" == "null" ]||[ "${gdbots}" == "0" ]; then + unset gdbots + fi + fi +fi diff --git a/lgsm/functions/gsquery.py b/lgsm/functions/query_gsquery.py similarity index 67% rename from lgsm/functions/gsquery.py rename to lgsm/functions/query_gsquery.py index 512d7411b..fe809be15 100644 --- a/lgsm/functions/gsquery.py +++ b/lgsm/functions/query_gsquery.py @@ -1,16 +1,15 @@ #! /usr/bin/env python # -*- coding: utf-8 -*- -# Game Server Query +# query_gsquery.py # Author: Anonymous & Daniel Gibbs -# Website: https://gameservermanagers.com -# Description: Handles querying of . +# Website: https://linuxgsm.com +# Description: Allows querying of various game servers. import optparse import socket import sys - -class GameServer: +class gsquery: def __init__(self, options, arguments): self.option = options self.argument = arguments @@ -18,36 +17,25 @@ class GameServer: self.server_response_timeout = 5 self.default_buffer_length = 1024 # - if self.option.engine == 'avalanche': - self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40' - elif self.option.engine == 'goldsource': + sourcequery=[ 'avalanche3.0','madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d', 'unreal4', 'wurm' ] + idtech3query=['idtech3','iw3.0','ioquake3'] + idtech2query=['idtech2','quake','iw2.0'] + minecraftquery=['minecraft','lwjgl2'] + if self.option.engine in sourcequery: self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' - elif self.option.engine == 'idtech2': + elif self.option.engine in idtech2query: self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00' - elif self.option.engine == 'idtech3': - self.query_prompt_string = b'\xff\xff\xff\xffgetstatus' - elif self.option.engine == 'iw2.0': + elif self.option.engine in idtech3query: self.query_prompt_string = b'\xff\xff\xff\xffgetstatus' - elif self.option.engine == 'iw3.0': - self.query_prompt_string = b'\xff\xff\xff\xffgetstatus' - elif self.option.engine == 'quake': - self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00' - elif self.option.engine == 'quakelive': - self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' - elif self.option.engine == 'realvirtuality': - self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' - elif self.option.engine == 'refractor': - self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' - elif self.option.engine == 'source': - self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' - elif self.option.engine == 'spark': - self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' - elif self.option.engine == 'unity3d': - self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' + elif self.option.engine in minecraftquery: + self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93' + elif self.option.engine == 'avalanche2.0': + self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40' elif self.option.engine == 'unreal': self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C' elif self.option.engine == 'unreal2': self.query_prompt_string = b'\x79\x00\x00\x00\x00' + self.connected = False self.response = None self.sanity_checks() @@ -92,7 +80,6 @@ class GameServer: if not self.option.port: self.fatal_error('No port supplied.', 4) - if __name__ == '__main__': parser = optparse.OptionParser( usage='usage: python %prog [options]', @@ -117,7 +104,7 @@ if __name__ == '__main__': action='store', dest='engine', default=False, - help='Engine type: avalanche, goldsource, idtech2, idtech3, iw2.0, iw3.0, realvirtuality, quake, quakelive, refractor, spark, source, unity3d, unreal, unreal2.' + help='Engine type: avalanche2.0 avalanche3.0 goldsource idtech2 idtech3 ioquake3 iw2.0 iw3.0 madness quake quakelive realvirtuality refracto source spark starbound unity3d unreal unreal2 unreal4 wurm.' ) parser.add_option( '-v', '--verbose', @@ -135,5 +122,5 @@ if __name__ == '__main__': ) options, arguments = parser.parse_args() # - server = GameServer(options, arguments) + server = gsquery(options, arguments) server.responding() diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh new file mode 100644 index 000000000..c6d27ee65 --- /dev/null +++ b/lgsm/functions/update_factorio.sh @@ -0,0 +1,162 @@ +#!/bin/bash +# LinuxGSM update_factorio.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Handles updating of Factorio servers. + +local commandname="UPDATE" +local commandaction="Update" +local function_selfname="$(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" + 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 + fi +} + +fn_update_factorio_localbuild(){ + # Gets local build info. + fn_print_dots "Checking for update: ${remotelocation}: checking local build" + # 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=$(${curlpath} -s "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1) + if [ "${installer}" != "1" ]; then + fn_print_dots "Checking for update: ${remotelocation}: checking remote build" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking for update: ${remotelocation}: checking remote build" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking for update: ${remotelocation}: checking remote build" + 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. + localbuilddigit=$(echo "${localbuild}" | tr -cd '[:digit:]') + remotebuilddigit=$(echo "${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 [ -v "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + 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}" + fn_sleep_time + echo -en "\n" + echo -en "applying update.\r" + sleep 1 + echo -en "applying update..\r" + sleep 1 + echo -en "applying update...\r" + sleep 1 + echo -en "\n" + + unset updateonstart + + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + exitbypass=1 + fn_update_factorio_dl + exitbypass=1 + command_start.sh + exitbypass=1 + command_stop.sh + # If server started. + else + exitbypass=1 + command_stop.sh + exitbypass=1 + fn_update_factorio_dl + exitbypass=1 + command_start.sh + fi + 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 + 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 [ "${installer}" == "1" ]; then + fn_update_factorio_remotebuild + fn_update_factorio_dl +else + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_factorio_localbuild + fn_update_factorio_remotebuild + fn_update_factorio_compare +fi diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh index 717e798cd..8fa3ef40a 100644 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/functions/update_minecraft.sh @@ -1,157 +1,194 @@ #!/bin/bash -# LGSM update_minecraft.sh function +# LinuxGSM update_minecraft.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Handles updating of Minecraft servers. local commandname="UPDATE" local commandaction="Update" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_dl(){ - fn_fetch_file "https://s3.amazonaws.com/Minecraft.Download/versions/${availablebuild}/minecraft_server.${availablebuild}.jar" "${tmpdir}" "minecraft_server.${availablebuild}.jar" - echo -e "copying to ${filesdir}...\c" - fn_script_log "Copying to ${filesdir}" - cp "${tmpdir}/minecraft_server.${availablebuild}.jar" "${filesdir}/minecraft_server.jar" +fn_update_minecraft_dl(){ + latestmcreleaselink=$(${curlpath} -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | jq -r '.latest.release as $latest | .versions[] | select(.id == $latest) | .url') + latestmcbuildurl=$(${curlpath} -s "${latestmcreleaselink}" | jq -r '.downloads.server.url') + fn_fetch_file "${latestmcbuildurl}" "${tmpdir}" "minecraft_server.${remotebuild}.jar" + echo -e "copying to ${serverfiles}...\c" + cp "${tmpdir}/minecraft_server.${remotebuild}.jar" "${serverfiles}/minecraft_server.jar" local exitcode=$? - if [ ${exitcode} -eq 0 ]; then + 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}" + core_exit.sh fi } -fn_update_currentbuild(){ - # Gets current build info - # Checks if current build info is available. If it fails, then a server restart will be forced to generate logs. - if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then - fn_print_error "Checking for update: mojang.com" - sleep 1 - fn_print_error_nl "Checking for update: mojang.com: No logs with server version found" - fn_script_log_error "Checking for update: mojang.com: No logs with server version found" - sleep 1 - fn_print_info_nl "Checking for update: mojang.com: Forcing server restart" - fn_script_log_info "Checking for update: mojang.com: Forcing server restart" - sleep 1 +fn_update_minecraft_localbuild(){ + # Gets local build info. + fn_print_dots "Checking for update: ${remotelocation}: checking local build" + # Uses log file to gather info. + # Gives time for log file to generate. + if [ ! -f "${serverfiles}/logs/latest.log" ]; then + fn_print_error "Checking for update: ${remotelocation}: checking local build" + fn_print_error_nl "Checking for update: ${remotelocation}: checking local build: no log files" + fn_script_log_error "No log file found" + fn_print_info_nl "Checking for update: ${remotelocation}: checking local build: forcing server restart" + fn_script_log_info "Forcing server restart" exitbypass=1 command_stop.sh exitbypass=1 command_start.sh - sleep 1 - # Check again and exit on failure. - if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then - fn_print_fail_nl "Checking for update: mojang.com: Still No logs with server version found" - fn_script_log_fatal "Checking for update: mojang.com: Still No logs with server version found" - core_exit.sh - fi + totalseconds=0 + # Check again, allow time to generate logs. + while [ ! -f "${serverfiles}/logs/latest.log" ]; do + sleep 1 + fn_print_info "Checking for update: ${remotelocation}: checking local build: 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 for update: ${remotelocation}: waiting for log file: missing log file" + fn_script_log_error "Missing log file" + fn_script_log_error "Set localbuild to 0" + fi + + totalseconds=$((totalseconds + 1)) + done fi - # Get current build from logs - currentbuild=$(cat "${filesdir}/logs/latest.log" 2> /dev/null | grep version | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') - if [ -z "${currentbuild}" ]; then - fn_print_error_nl "Checking for update: mojang.com: Current build version not found" - fn_script_log_error "Checking for update: mojang.com: Current build version not found" - sleep 1 - fn_print_info_nl "Checking for update: mojang.com: Forcing server restart" - fn_script_log_info "Checking for update: mojang.com: Forcing server restart" - exitbypass=1 - command_stop.sh - exitbypass=1 - command_start.sh - currentbuild=$(cat "${filesdir}/logs/latest.log" 2> /dev/null | grep version | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') - if [ -z "${currentbuild}" ]; then - fn_print_fail_nl "Checking for update: mojang.com: Current build version still not found" - fn_script_log_fatal "Checking for update: mojang.com: Current build version still not found" - core_exit.sh - fi + if [ -z "${localbuild}" ]; then + localbuild=$(cat "${serverfiles}/logs/latest.log" 2> /dev/null | grep version | grep -Eo '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') fi -} -fn_update_availablebuild(){ - # Gets latest build info. - availablebuild=$(curl -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | sed -e 's/^.*"release":"\([^"]*\)".*$/\1/') - sleep 1 + if [ -z "${localbuild}" ]; then + # Gives time for var to generate. + totalseconds=0 + for seconds in {1..120}; do + fn_print_info "Checking for update: ${remotelocation}: checking local build: waiting for local build: ${totalseconds}" + if [ -z "${loopignore}" ]; then + loopignore=1 + fn_script_log_info "Waiting for local build to generate" + fi + localbuild=$(cat "${serverfiles}/logs/latest.log" 2> /dev/null | grep version | grep -Eo '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') + if [ "${localbuild}" ]||[ "${seconds}" == "120" ]; then + break + fi + sleep 1 + totalseconds=$((totalseconds + 1)) + done + fi - # Checks if availablebuild variable has been set - if [ -z "${availablebuild}" ]; then - fn_print_fail "Checking for update: mojang.com" - sleep 1 - fn_print_fail "Checking for update: mojang.com: Not returning version info" - fn_script_log_fatal "Failure! Checking for update: mojang.com: Not returning version info" - core_exit.sh + if [ -z "${localbuild}" ]; then + localbuild="0" + fn_print_error "Checking for update: ${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_nl "Checking for update: mojang.com" - fn_script_log_pass "Checking for update: mojang.com" - sleep 1 + fn_print_ok "Checking for update: ${remotelocation}: checking local build" + fn_script_log_pass "Checking local build" fi } -fn_update_compare(){ - # Removes dots so if can compare version numbers - currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]') - availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]') +fn_update_minecraft_remotebuild(){ + # Gets remote build info. + remotebuild=$(${curlpath} -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.release') + if [ "${installer}" != "1" ]; then + fn_print_dots "Checking for update: ${remotelocation}: checking remote build" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking for update: ${remotelocation}: checking remote build" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking for update: ${remotelocation}: checking remote build" + 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 +} - if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then - echo -e "\n" - echo -e "Update available:" - sleep 1 - echo -e " Current build: ${red}${currentbuild}${default}" - echo -e " Available build: ${green}${availablebuild}${default}" - echo -e "" - sleep 1 - echo "" - echo -en "Applying update.\r" +fn_update_minecraft_compare(){ + # Removes dots so if statement can compare version numbers. + fn_print_dots "Checking for update: ${remotelocation}" + localbuilddigit=$(echo "${localbuild}" | tr -cd '[:digit:]') + remotebuilddigit=$(echo "${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}" + fn_sleep_time + echo -en "\n" + echo -en "applying update.\r" sleep 1 - echo -en "Applying update..\r" + echo -en "applying update..\r" sleep 1 - echo -en "Applying update...\r" + echo -en "applying update...\r" sleep 1 echo -en "\n" - fn_script_log "Update available" - fn_script_log "Current build: ${currentbuild}" - fn_script_log "Available build: ${availablebuild}" - fn_script_log "${currentbuild} > ${availablebuild}" unset updateonstart check_status.sh + # If server stopped. if [ "${status}" == "0" ]; then - fn_update_dl + exitbypass=1 + fn_update_minecraft_dl exitbypass=1 command_start.sh exitbypass=1 command_stop.sh + # If server started. else exitbypass=1 command_stop.sh - fn_update_dl + exitbypass=1 + fn_update_minecraft_dl exitbypass=1 command_start.sh fi alert="update" alert.sh else - echo -e "\n" - echo -e "No update available:" - echo -e " Current version: ${green}${currentbuild}${default}" - echo -e " Available version: ${green}${availablebuild}${default}" - echo -e "" - fn_print_ok_nl "No update available" - fn_script_log_info "Current build: ${currentbuild}" - fn_script_log_info "Available build: ${availablebuild}" + 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}" + 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="mojang.com" if [ "${installer}" == "1" ]; then - fn_update_availablebuild - fn_update_dl + fn_update_minecraft_remotebuild + fn_update_minecraft_dl else - # Checks for server update from mojang.com - fn_print_dots "Checking for update: mojang.com" - fn_script_log_info "Checking for update: mojang.com" - sleep 1 - fn_update_currentbuild - fn_update_availablebuild - fn_update_compare + 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 100644 index 000000000..935ab474e --- /dev/null +++ b/lgsm/functions/update_mta.sh @@ -0,0 +1,204 @@ +#!/bin/bash +# LinuxGSM update_mta.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Handles updating of Multi Theft Auto servers. + +local commandname="UPDATE" +local commandaction="Update" +local function_selfname="$(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" + 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=$? + if [ "${exitcode}" == "0" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "Copying to ${serverfiles}" + chmod u+x "${serverfiles}/mta-server64" + fn_clear_tmp + 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 for update: ${remotelocation}: checking local build" + # Uses log file to gather info. + # Gives time for log file to generate. + if [ ! -f "${serverfiles}/mods/deathmatch/logs/server.log" ]; then + fn_print_error "Checking for update: ${remotelocation}: checking local build" + fn_print_error_nl "Checking for update: ${remotelocation}: checking local build: no log files" + fn_script_log_error "No log file found" + fn_print_info_nl "Checking for update: ${remotelocation}: checking local build: forcing server restart" + fn_script_log_info "Forcing server restart" + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + totalseconds=0 + # Check again, allow time to generate logs. + while [ ! -f "${serverfiles}/mods/deathmatch/logs/server.log" ]; do + sleep 1 + fn_print_info "Checking for update: ${remotelocation}: checking local build: 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 for update: ${remotelocation}: waiting for log file: missing log file" + fn_script_log_error "Missing log file" + fn_script_log_error "Set localbuild to 0" + 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. + end=$((SECONDS+120)) + totalseconds=0 + while [ "${SECONDS}" -lt "${end}" ]; do + fn_print_info "Checking for update: ${remotelocation}: checking local build: 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 for update: ${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 for update: ${remotelocation}: checking local build" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_mta_remotebuild(){ + # Gets remote build info. + majorversion="$(curl -s https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h | grep "#define MTASA_VERSION_MAJOR" | awk '{ print $3 }' | sed 's/\r//g')" + minorversion="$(curl -s https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h | grep "#define MTASA_VERSION_MINOR" | awk '{ print $3 }' | sed 's/\r//g')" + maintenanceversion="$(curl -s https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h | grep "#define MTASA_VERSION_MAINTENANCE" | awk '{ print $3 }' | sed 's/\r//g')" + remotebuild="${majorversion}.${minorversion}.${maintenanceversion}" + if [ "${installer}" != "1" ]; then + fn_print_dots "Checking for update: ${remotelocation}: checking remote build" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking for update: ${remotelocation}: checking remote build" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking for update: ${remotelocation}: checking remote build" + 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 "${localbuild}" | tr -cd '[:digit:]') + remotebuilddigit=$(echo "${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}" + 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}" + fn_sleep_time + echo -en "\n" + echo -en "applying update.\r" + sleep 1 + echo -en "applying update..\r" + sleep 1 + echo -en "applying update...\r" + sleep 1 + echo -en "\n" + + unset updateonstart + + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + exitbypass=1 + fn_update_mta_dl + exitbypass=1 + command_start.sh + exitbypass=1 + command_stop.sh + # If server started. + else + exitbypass=1 + command_stop.sh + exitbypass=1 + fn_update_mta_dl + exitbypass=1 + command_start.sh + fi + 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}" + 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 [ "${installer}" == "1" ]; then + fn_update_mta_remotebuild + fn_update_mta_dl +else + 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 index 338ad4545..eb0bdcda3 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -1,136 +1,111 @@ #!/bin/bash -# LGSM update_mumble.sh function +# LinuxGSM update_mumble.sh function # Author: Daniel Gibbs -# Contributor: UltimateByte -# Website: https://gameservermanagers.com -# Description: Handles updating of mumble servers. +# Website: https://linuxgsm.com +# Description: Handles updating of Mumble servers. local commandname="UPDATE" local commandaction="Update" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_mumble_dl(){ - fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${availablebuild}/murmur-static_${mumblearch}-${availablebuild}.tar.bz2" "${tmpdir}" "murmur-static_${mumblearch}-${availablebuild}.tar.bz2" - fn_dl_extract "${tmpdir}" "murmur-static_${mumblearch}-${availablebuild}.tar.bz2" "${tmpdir}" - echo -e "copying to ${filesdir}...\c" - fn_script_log "Copying to ${filesdir}" - cp -R "${tmpdir}/murmur-static_${mumblearch}-${availablebuild}/"* "${filesdir}" + 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" + 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} -eq 0 ]; then + 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_mumble_currentbuild(){ - # Gets current build info - # Checks if current build info is available. If it fails, then a server restart will be forced to generate logs. - if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then - fn_print_error "Checking for update: GitHub" - sleep 1 - fn_print_error_nl "Checking for update: GitHub: No logs with server version found" - fn_script_log_error "Checking for update: GitHub: No logs with server version found" - sleep 1 - fn_print_info_nl "Checking for update: GitHub: Forcing server restart" - fn_script_log_info "Checking for update: GitHub: Forcing server restart" - sleep 1 - exitbypass=1 - command_stop.sh - exitbypass=1 - command_start.sh - sleep 1 - # Check again and exit on failure. - if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then - fn_print_fail_nl "Checking for update: GitHub: Still No logs with server version found" - fn_script_log_fatal "Checking for update: GitHub: Still No logs with server version found" - core_exit.sh - fi +fn_update_mumble_localbuild(){ + # Gets local build info. + fn_print_dots "Checking for update: ${remotelocation}: checking local build" + # 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 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 +} - # Get current build from logs - currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | egrep 'Murmur ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | awk '{print $4}') - if [ -z "${currentbuild}" ]; then - fn_print_error_nl "Checking for update: GitHub: Current build version not found" - fn_script_log_error "Checking for update: GitHub: Current build version not found" - sleep 1 - fn_print_info_nl "Checking for update: GitHub: Forcing server restart" - fn_script_log_info "Checking for update: GitHub: Forcing server restart" - exitbypass=1 - command_stop.sh - exitbypass=1 - command_start.sh - currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | egrep 'Murmur ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | awk '{print $4}') - if [ -z "${currentbuild}" ]; then - fn_print_fail_nl "Checking for update: GitHub: Current build version still not found" - fn_script_log_fatal "Checking for update: GitHub: Current build version still not found" +fn_update_mumble_remotebuild(){ + # Gets remote build info. + remotebuild=$(${curlpath} -s "https://api.github.com/repos/mumble-voip/mumble/releases/latest" | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }') + if [ "${installer}" != "1" ]; then + fn_print_dots "Checking for update: ${remotelocation}: checking remote build" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking for update: ${remotelocation}: checking remote build" + fn_script_log_fatal "Checking remote build" core_exit.sh + else + fn_print_ok "Checking for update: ${remotelocation}: checking remote build" + fn_script_log_pass "Checking remote build" fi - fi -} - -fn_update_mumble_arch(){ - # Mumble is x86 only for now - mumblearch="x86" -} - -fn_update_mumble_availablebuild(){ - # Gets latest build info. - availablebuild=$(curl -s https://api.github.com/repos/mumble-voip/mumble/releases/latest | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }') - sleep 1 - - # Checks if availablebuild variable has been set - if [ -z "${availablebuild}" ]; then - fn_print_fail "Checking for update: GitHub" - sleep 1 - fn_print_fail "Checking for update: GitHub: Not returning version info" - fn_script_log_fatal "Failure! Checking for update: GitHub: Not returning version info" - core_exit.sh else - fn_print_ok "Checking for update: GitHub" - fn_script_log_pass "Checking for update: GitHub" - sleep 1 + # 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 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: ${red}${currentbuild} ${mumblearch}${default}" - echo -e " Available build: ${green}${availablebuild} ${mumblearch}${default}" - echo -e "" - sleep 1 - echo "" - echo -en "Applying update.\r" + # Removes dots so if statement can compare version numbers. + fn_print_dots "Checking for update: ${remotelocation}" + localbuilddigit=$(echo "${localbuild}" | tr -cd '[:digit:]') + remotebuilddigit=$(echo "${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}" + 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}" + fn_sleep_time + echo -en "\n" + echo -en "applying update.\r" sleep 1 - echo -en "Applying update..\r" + echo -en "applying update..\r" sleep 1 - echo -en "Applying update...\r" + echo -en "applying update...\r" sleep 1 echo -en "\n" - fn_script_log "Update available" - fn_script_log "Current build: ${currentbuild}" - fn_script_log "Available build: ${availablebuild}" - fn_script_log "${currentbuild} > ${availablebuild}" unset updateonstart check_status.sh + # If server stopped. if [ "${status}" == "0" ]; then + exitbypass=1 fn_update_mumble_dl exitbypass=1 command_start.sh exitbypass=1 command_stop.sh + # If server started. else exitbypass=1 command_stop.sh + exitbypass=1 fn_update_mumble_dl exitbypass=1 command_start.sh @@ -138,28 +113,30 @@ fn_update_mumble_compare(){ alert="update" alert.sh else - echo -e "\n" - echo -e "No update available:" - echo -e " Current version: ${green}${currentbuild}${default}" - echo -e " Available version: ${green}${availablebuild}${default}" - echo -e "" - fn_print_ok_nl "No update available" - fn_script_log_info "Current build: ${currentbuild}" - fn_script_log_info "Available build: ${availablebuild}" + 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}" + 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" -fn_update_mumble_arch if [ "${installer}" == "1" ]; then - fn_update_mumble_availablebuild + fn_update_mumble_remotebuild fn_update_mumble_dl else - # Checks for server update from github.com - fn_print_dots "Checking for update: github.com" - fn_script_log_info "Checking for update: github.com" - sleep 1 - fn_update_mumble_currentbuild - fn_update_mumble_availablebuild + 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 index 14a1334d0..6ed557140 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -1,44 +1,150 @@ #!/bin/bash -# LGSM update_steamcmd.sh function +# LinuxGSM update_steamcmd.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com +# Website: https://linuxgsm.com # Description: Handles updating using SteamCMD. local commandname="UPDATE" local commandaction="Update" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" - -check.sh +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_steamcmd_dl(){ info_config.sh - fn_print_dots "SteamCMD" - sleep 1 - fn_print_ok_nl "SteamCMD" - fn_script_log_info "Starting SteamCMD" - - cd "${rootdir}/steamcmd" # Detects if unbuffer command is available for 32 bit distributions only. info_distro.sh - if [ $(command -v stdbuf) ]&&[ "${arch}" != "x86_64" ]; then + if [ "$(command -v stdbuf)" ]&&[ "${arch}" != "x86_64" ]; then unbuffer="stdbuf -i0 -o0 -e0" fi - if [ "${engine}" == "goldsource" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" ${branch} +quit | tee -a "${scriptlog}" + cd "${steamcmddir}" || exit + if [ "${appid}" == "90" ]; then + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}" + elif [ "${shortname}" == "unt" ]; then + ${unbuffer} ./steamcmd.sh +@sSteamCmdForcePlatformBitness 32 +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} validate +quit elif [ "${gamename}" == "Jedi Knight II: Jedi Outcast" ]; ${unbuffer} ./steamcmd.sh +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} +quit | tee -a "${scriptlog}" else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} +quit | tee -a "${scriptlog}" + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}" fi - fix.sh } +fn_update_steamcmd_localbuild(){ + # Gets local build info. + fn_print_dots "Checking for update: ${remotelocation}: checking local build" + fn_appmanifest_check + # Uses appmanifest to find local build. + localbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) + + # Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD. + if [ -f "${HOME}/Steam/appcache/appinfo.vdf" ]; then + rm -f "${HOME}/Steam/appcache/appinfo.vdf" + fi + + # Set branch for updateinfo. + IFS=' ' read -ra branchsplits <<< "${branch}" + if [ "${#branchsplits[@]}" -gt 1 ]; then + branchname="${branchsplits[1]}" + else + branchname="public" + fi + fn_sleep_time +} + +fn_update_steamcmd_remotebuild(){ + # Gets remote build info. + cd "${steamcmddir}" || exit + remotebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed '1,/branches/d' | sed "1,/${branchname}/d" | grep -m 1 buildid | tr -cd '[:digit:]') + if [ "${installer}" != "1" ]; then + fn_print_dots "Checking for update: ${remotelocation}: checking remote build" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking for update: ${remotelocation}: checking remote build" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking for update: ${remotelocation}: checking remote build" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fatal "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_steamcmd_compare(){ + fn_print_dots "Checking for update: ${remotelocation}" + if [ "${localbuild}" != "${remotebuild}" ]; then + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "Update available" + echo -e "* Local build: ${red}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + if [ -v "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -e "https://steamdb.info/app/${appid}/" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -v "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuild}" + fn_sleep_time + echo -en "\n" + echo -en "applying update.\r" + sleep 1 + echo -en "applying update..\r" + sleep 1 + echo -en "applying update...\r" + sleep 1 + echo -en "\n" + + unset updateonstart + + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_steamcmd_dl + # If server started. + else + exitbypass=1 + command_stop.sh + exitbypass=1 + fn_update_steamcmd_dl + exitbypass=1 + command_start.sh + fi + alert="update" + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + if [ -v "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -e "https://steamdb.info/app/${appid}/" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -v "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fi +} + fn_appmanifest_info(){ - appmanifestfile=$(find "${filesdir}" -type f -name "appmanifest_${appid}.acf") - appmanifestfilewc=$(find "${filesdir}" -type f -name "appmanifest_${appid}.acf"|wc -l) + appmanifestfile=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf") + appmanifestfilewc=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf" | wc -l) } fn_appmanifest_check(){ @@ -46,22 +152,18 @@ fn_appmanifest_check(){ # Multiple or no matching appmanifest files may sometimes be present. # This error is corrected if required. if [ "${appmanifestfilewc}" -ge "2" ]; then - sleep 1 + fn_sleep_time fn_print_error "Multiple appmanifest_${appid}.acf files found" fn_script_log_error "Multiple appmanifest_${appid}.acf files found" - sleep 2 fn_print_dots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files" - sleep 1 for appfile in ${appmanifestfile}; do rm "${appfile}" done - sleep 1 appmanifestfilewc1="${appmanifestfilewc}" fn_appmanifest_info if [ "${appmanifestfilewc}" -ge "2" ]; then fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" fn_script_log_fatal "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" - sleep 1 echo " * Check user permissions" for appfile in ${appmanifestfile}; do echo " ${appfile}" @@ -70,162 +172,32 @@ fn_appmanifest_check(){ else fn_print_ok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" fn_script_log_pass "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" - sleep 1 fn_print_info_nl "Forcing update to correct issue" fn_script_log_info "Forcing update to correct issue" - sleep 1 fn_update_steamcmd_dl - fn_update_request_log fi elif [ "${appmanifestfilewc}" -eq "0" ]; then - fn_print_error "No appmanifest_${appid}.acf found" + fn_print_error_nl "No appmanifest_${appid}.acf found" fn_script_log_error "No appmanifest_${appid}.acf found" - sleep 1 fn_print_info_nl "Forcing update to correct issue" fn_script_log_info "Forcing update to correct issue" - sleep 1 fn_update_steamcmd_dl - fn_update_request_log fn_appmanifest_info if [ "${appmanifestfilewc}" -eq "0" ]; then - fn_print_fatal "Still no appmanifest_${appid}.acf found" + fn_print_fail_nl "Still no appmanifest_${appid}.acf found" fn_script_log_fatal "Still no appmanifest_${appid}.acf found" core_exit.sh fi fi } -fn_update_request_log(){ - # Checks for server update requests from server logs. - fn_print_dots "Checking for update: Server logs" - fn_script_log_info "Checking for update: Server logs" - sleep 1 - requestrestart=$(grep -Ec "MasterRequestRestart" "${consolelog}") - if [ "${requestrestart}" -ge "1" ]; then - fn_print_ok_nl "Checking for update: Server logs: Update requested" - fn_script_log_pass "Checking for update: Server logs: Update requested" - 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" - - unset updateonstart - check_status.sh - if [ "${status}" != "0" ]; then - exitbypass=1 - command_stop.sh - fn_update_steamcmd_dl - exitbypass=1 - command_start.sh - else - fn_update_steamcmd_dl - fi - alert="update" - alert.sh - else - fn_print_ok "Checking for update: Server logs: No update requested" - sleep 1 - fi -} - -fn_update_steamcmd_check(){ - fn_appmanifest_check - # Checks for server update from SteamCMD - fn_print_dots "Checking for update: SteamCMD" - fn_script_log_info "Checking for update: SteamCMD" - sleep 1 - - # Gets currentbuild - currentbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) - - # Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD - cd "${rootdir}/steamcmd" - if [ -f "${HOME}/Steam/appcache/appinfo.vdf" ]; then - rm -f "${HOME}/Steam/appcache/appinfo.vdf" - fi - - # Set branch for updateinfo - IFS=' ' read -a branchsplits <<< "${branch}" - if [ "${#branchsplits[@]}" -gt 1 ]; then - branchname="${branchsplits[1]}" - else - branchname="public" - fi - - # Gets availablebuild info - 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+\"${branchname}\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) - if [ -z "${availablebuild}" ]; then - fn_print_fail "Checking for update: SteamCMD" - sleep 1 - fn_print_fail_nl "Checking for update: SteamCMD: Not returning version info" - fn_script_log_fatal "Checking for update: SteamCMD: Not returning version info" - core_exit.sh - else - fn_print_ok "Checking for update: SteamCMD" - fn_script_log_pass "Checking for update: SteamCMD" - sleep 1 - fi - - if [ "${currentbuild}" != "${availablebuild}" ]; then - fn_print_ok "Checking for update: SteamCMD: Update available" - fn_script_log_pass "Checking for update: SteamCMD: Update available" - echo -e "\n" - echo -e "Update available:" - sleep 1 - echo -e " Current build: ${red}${currentbuild}${default}" - echo -e " Available build: ${green}${availablebuild}${default}" - 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_script_log_info "Update available" - fn_script_log_info "Current build: ${currentbuild}" - fn_script_log_info "Available build: ${availablebuild}" - fn_script_log_info "${currentbuild} > ${availablebuild}" - - unset updateonstart - check_status.sh - if [ "${status}" != "0" ]; then - exitbypass=1 - command_stop.sh - fn_update_steamcmd_dl - exitbypass=1 - command_start.sh - else - fn_update_steamcmd_dl - fi - alert="update" - alert.sh - else - fn_print_ok "Checking for update: SteamCMD: No update available" - fn_script_log_pass "Checking for update: SteamCMD: No update available" - echo -e "\n" - echo -e "No update available:" - echo -e " Current version: ${green}${currentbuild}${default}" - echo -e " Available version: ${green}${availablebuild}${default}" - echo -e " https://steamdb.info/app/${appid}/" - echo -e "" - fn_script_log_info "Current build: ${currentbuild}" - fn_script_log_info "Available build: ${availablebuild}" - fi -} +# The location where the builds are checked and downloaded. +remotelocation="SteamCMD" +check.sh -if [ "${engine}" == "goldsource" ]||[ "${forceupdate}" == "1" ]; then - # Goldsource servers bypass checks as fn_update_steamcmd_check does not work for appid 90 servers. - # forceupdate bypasses checks +if [ "${forceupdate}" == "1" ]; then + # forceupdate bypasses update checks. check_status.sh if [ "${status}" != "0" ]; then exitbypass=1 @@ -237,6 +209,7 @@ if [ "${engine}" == "goldsource" ]||[ "${forceupdate}" == "1" ]; then fn_update_steamcmd_dl fi else - fn_update_request_log - fn_update_steamcmd_check + 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 index 5e897f7b9..31a015e6e 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -1,163 +1,175 @@ #!/bin/bash -# LGSM command_ts3.sh function +# LinuxGSM command_ts3.sh function # Author: Daniel Gibbs -# Website: https://gameservermanagers.com -# Description: Handles updating of teamspeak 3 servers. +# Website: https://linuxgsm.com +# Description: Handles updating of Teamspeak 3 servers. local commandname="UPDATE" local commandaction="Update" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_ts3_dl(){ - fn_fetch_file "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" - fn_dl_extract "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" "${tmpdir}" - echo -e "copying to ${filesdir}...\c" - fn_script_log "Copying to ${filesdir}" - cp -R "${tmpdir}/teamspeak3-server_linux_${ts3arch}/"* "${filesdir}" + if [ "${ts3arch}" == "amd64" ]; then + remotebuildurl=$(${curlpath} -s 'https://www.teamspeak.com/versions/server.json' | jq -r '.linux.x86_64.mirrors."teamspeak.com"') + elif [ "${ts3arch}" == "x86" ]; then + remotebuildurl=$(${curlpath} -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" + 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} -eq 0 ]; then + 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_ts3_currentbuild(){ - # 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_print_error "Checking for update: teamspeak.com" - sleep 1 - fn_print_error_nl "Checking for update: teamspeak.com: No logs with server version found" - fn_script_log_error "Checking for update: teamspeak.com: No logs with server version found" - sleep 1 - fn_print_info_nl "Checking for update: teamspeak.com: Forcing server restart" - fn_script_log_info "Checking for update: teamspeak.com: Forcing server restart" - sleep 1 +fn_update_ts3_localbuild(){ + # Gets local build info. + fn_print_dots "Checking for update: ${remotelocation}: checking local build" + fn_sleep_time + # Uses log file to gather info. + # Gives time for log file to generate. + if [ ! -d "${serverfiles}/logs" ]||[ -z "$(find "${serverfiles}/logs/"* -name 'ts3server*_0.log' 2> /dev/null)" ]; then + fn_print_error "Checking for update: ${remotelocation}: checking local build" + fn_print_error_nl "Checking for update: ${remotelocation}: checking local build: no log files" + fn_script_log_error "No log file found" + fn_print_info_nl "Checking for update: ${remotelocation}: checking local build: forcing server restart" + fn_script_log_info "Forcing server restart" exitbypass=1 command_stop.sh exitbypass=1 command_start.sh - sleep 1 - # Check again and exit on failure. - if [ -z "$(find ./* -name 'ts3server*_0.log')" ]; then - fn_print_fail_nl "Checking for update: teamspeak.com: Still No logs with server version found" - fn_script_log_fatal "Checking for update: teamspeak.com: Still No logs with server version found" - core_exit.sh - fi + 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 for update: ${remotelocation}: checking local build: 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 for update: ${remotelocation}: waiting for log file: missing log file" + fn_script_log_error "Missing log file" + fn_script_log_error "Set localbuild to 0" + fi + + totalseconds=$((totalseconds + 1)) + done fi - # Get current build from logs - 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}' | sort -V | tail -1) - if [ -z "${currentbuild}" ]; then - fn_print_error_nl "Checking for update: teamspeak.com: Current build version not found" - fn_script_log_error "Checking for update: teamspeak.com: Current build version not found" - sleep 1 - fn_print_info_nl "Checking for update: teamspeak.com: Forcing server restart" - fn_script_log_info "Checking for update: teamspeak.com: Forcing server restart" - exitbypass=1 - command_stop.sh - exitbypass=1 - command_start.sh - 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}') - if [ -z "${currentbuild}" ]; then - fn_print_fail_nl "Checking for update: teamspeak.com: Current build version still not found" - fn_script_log_fatal "Checking for update: teamspeak.com: Current build version still not found" - core_exit.sh - 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}") fi -} -fn_update_ts3_arch(){ -# Gets the teamspeak server architecture. -info_distro.sh -if [ "${arch}" == "x86_64" ]; then - ts3arch="amd64" -elif [ "${arch}" == "i386" ]||[ "${arch}" == "i686" ]; then - ts3arch="x86" -else - echo "" - fn_print_failure "Unknown or unsupported architecture: ${arch}" - fn_script_log_fatal "Unknown or unsupported architecture: ${arch}" - core_exit.sh -fi -} - -fn_update_ts3_availablebuild(){ - # Gets latest build info. - - # Grabs all version numbers but 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 > "${tmpdir}/.ts3_version_numbers_unsorted.tmp" + if [ -z "${localbuild}" ]; then + # Gives time for var to generate. + end=$((SECONDS+120)) + totalseconds=0 + while [ "${SECONDS}" -lt "${end}" ]; do + fn_print_info "Checking for update: ${remotelocation}: checking local build: 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}") + if [ "${localbuild}" ]; then + break + fi + sleep 1 + totalseconds=$((totalseconds + 1)) + done + fi - # Sort version numbers - cat "${tmpdir}/.ts3_version_numbers_unsorted.tmp" | sort -r --version-sort -o "${tmpdir}/.ts3_version_numbers_sorted.tmp" + if [ -z "${localbuild}" ]; then + localbuild="0" + fn_print_error "Checking for update: ${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 for update: ${remotelocation}: checking local build" + fn_script_log_pass "Checking local build" + fi +} - # 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.bz2" - if [ $? -eq 0 ]; then - availablebuild="${ts3_version_number}" - # Break while-loop, if the latest release could be found. - break +fn_update_ts3_remotebuild(){ + # Gets remote build info. + if [ "${arch}" == "x86_64" ]; then + remotebuild="$(${curlpath} -s "https://www.teamspeak.com/versions/server.json" | jq -r '.linux.x86_64.version')" + elif [ "${arch}" == "x86" ]; then + remotebuild="$(${curlpath} -s "https://www.teamspeak.com/versions/server.json" | jq -r '.linux.x86.version')" + fi + if [ "${installer}" != "1" ]; then + fn_print_dots "Checking for update: ${remotelocation}: checking remote build" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking for update: ${remotelocation}: checking remote build" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking for update: ${remotelocation}: checking remote build" + fn_script_log_pass "Checking remote build" fi - done < "${tmpdir}/.ts3_version_numbers_sorted.tmp" - - # Tidy up - rm -f "${tmpdir}/.ts3_version_numbers_unsorted.tmp" - rm -f "${tmpdir}/.ts3_version_numbers_sorted.tmp" - - # Checks availablebuild info is available - if [ -z "${availablebuild}" ]; then - fn_print_fail "Checking for update: teamspeak.com" - sleep 1 - fn_print_fail "Checking for update: teamspeak.com: Not returning version info" - fn_script_log_fatal "Failure! Checking for update: teamspeak.com: Not returning version info" - core_exit.sh else - fn_print_ok "Checking for update: teamspeak.com" - fn_script_log_pass "Checking for update: teamspeak.com" - sleep 1 + # 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 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: ${red}${currentbuild} ${ts3arch}${default}" - echo -e " Available build: ${green}${availablebuild} ${ts3arch}${default}" - echo -e "" - sleep 1 - echo "" - echo -en "Applying update.\r" + # Removes dots so if statement can compare version numbers. + fn_print_dots "Checking for update: ${remotelocation}" + localbuilddigit=$(echo "${localbuild}" | tr -cd '[:digit:]') + remotebuilddigit=$(echo "${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}" + fn_sleep_time + echo -en "\n" + echo -en "applying update.\r" sleep 1 - echo -en "Applying update..\r" + echo -en "applying update..\r" sleep 1 - echo -en "Applying update...\r" + echo -en "applying update...\r" sleep 1 echo -en "\n" - fn_script_log "Update available" - fn_script_log "Current build: ${currentbuild}" - fn_script_log "Available build: ${availablebuild}" - fn_script_log "${currentbuild} > ${availablebuild}" unset updateonstart check_status.sh + # If server stopped. if [ "${status}" == "0" ]; then + exitbypass=1 fn_update_ts3_dl exitbypass=1 command_start.sh exitbypass=1 command_stop.sh + # If server started. else exitbypass=1 command_stop.sh + exitbypass=1 fn_update_ts3_dl exitbypass=1 command_start.sh @@ -165,28 +177,39 @@ fn_update_ts3_compare(){ alert="update" alert.sh else - echo -e "\n" - echo -e "No update available:" - echo -e " Current version: ${green}${currentbuild}${default}" - echo -e " Available version: ${green}${availablebuild}${default}" - echo -e "" - fn_print_ok_nl "No update available" - fn_script_log_info "Current build: ${currentbuild}" - fn_script_log_info "Available build: ${availablebuild}" + 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}" + 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" -fn_update_ts3_arch if [ "${installer}" == "1" ]; then - fn_update_ts3_availablebuild + fn_update_ts3_remotebuild fn_update_ts3_dl else - # Checks for server update from teamspeak.com using a mirror dl.4players.de. - fn_print_dots "Checking for update: teamspeak.com" - fn_script_log_info "Checking for update: teamspeak.com" - sleep 1 - fn_update_ts3_currentbuild - fn_update_ts3_availablebuild + 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/lib/gcc3/libgcc_s.so.1 b/lgsm/lib/gcc3/libgcc_s.so.1 deleted file mode 100644 index acb442512..000000000 Binary files a/lgsm/lib/gcc3/libgcc_s.so.1 and /dev/null differ diff --git a/lgsm/lib/gcc3/libstdc++.so.5.0.3 b/lgsm/lib/gcc3/libstdc++.so.5.0.3 deleted file mode 100755 index 65db75723..000000000 Binary files a/lgsm/lib/gcc3/libstdc++.so.5.0.3 and /dev/null differ diff --git a/lgsm/lib/ubuntu12.04/amd64/libc.so.6 b/lgsm/lib/ubuntu12.04/amd64/libc.so.6 new file mode 100644 index 000000000..c83c7057c Binary files /dev/null and b/lgsm/lib/ubuntu12.04/amd64/libc.so.6 differ diff --git a/lgsm/lib/ubuntu12.04/amd64/libm.so.6 b/lgsm/lib/ubuntu12.04/amd64/libm.so.6 new file mode 100644 index 000000000..3ec2d3420 Binary files /dev/null and b/lgsm/lib/ubuntu12.04/amd64/libm.so.6 differ diff --git a/linuxgsm.sh b/linuxgsm.sh new file mode 100755 index 000000000..c549ef46a --- /dev/null +++ b/linuxgsm.sh @@ -0,0 +1,381 @@ +#!/bin/bash +# Project: Game Server Managers - LinuxGSM +# Author: Daniel Gibbs +# License: MIT License, Copyright (c) 2019 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="v19.6.0" +shortname="core" +gameservername="core" +rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +servicename="${gameservername}" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/lgsm" +steamcmddir="${rootdir}/steamcmd" +serverfiles="${rootdir}/serverfiles" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" +tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +serverlist="${datadir}/serverlist.csv" +serverlistmenu="${datadir}/serverlistmenu.csv" +configdir="${lgsmdir}/config-lgsm" +configdirserver="${configdir}/${gameservername}" +configdirdefault="${lgsmdir}/config-default" +userinput="${1}" + +## 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}" + fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +} + +# Bootstrap +# Fetches the core functions required before passed off to core_dl.sh. + +# Fetches core functions. +fn_bootstrap_fetch_file(){ + remote_fileurl="${1}" + local_filedir="${2}" + local_filename="${3}" + chmodx="${4:-0}" + run="${5:-0}" + forcedl="${6:-0}" + md5="${7:-0}" + # Download file if missing or download forced. + if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + if [ ! -d "${local_filedir}" ]; then + mkdir -p "${local_filedir}" + fi + # Defines curl path. + curlpath=$(command -v curl 2>/dev/null) + + # If curl exists download file. + if [ "$(basename "${curlpath}")" == "curl" ]; then + # Trap to remove part downloaded files. + echo -en " fetching ${local_filename}...\c" + curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1) + local exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + if [ -f "${lgsmlog}" ]; then + echo -e "${remote_fileurl}" | tee -a "${lgsmlog}" + echo "${curlcmd}" | tee -a "${lgsmlog}" + fi + exit 1 + else + echo -e "OK" + fi + else + echo "[ FAIL ] Curl is not installed" + exit 1 + fi + # Make file chmodx if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" + fi + fi + + if [ -f "${local_filedir}/${local_filename}" ]; then + # Run file if run is set. + if [ "${run}" == "run" ]; then + source "${local_filedir}/${local_filename}" + fi + fi +} + +fn_bootstrap_fetch_file_github(){ + github_file_url_dir="${1}" + github_file_url_name="${2}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + + remote_fileurl="${githuburl}" + 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}" "${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(){ + char="${1:-=}" + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "${char}" +} + +# 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 "${line}" | awk -F "," '{print $2 " - " $3}') + menu_options+=( "${var}" ) + done < ${options} + menu_options+=( "Cancel" ) + select option in "${menu_options[@]}"; do + if [ -n "${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 "${line}" | awk -F "," '{print $3}') + val=$(echo "${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 [ -x "$(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 "Usage: $0 [option]" + echo -e "" + echo "Installer - Linux Game Server Managers - Version ${version}" + echo "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 + let 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 "Installed ${gamename} server as ${local_filename}" + echo "" + if [ ! -d "${serverfiles}" ]; then + echo "./${local_filename} install" + else + echo "Remember to check server ports" + echo "./${local_filename} details" + fi + echo "" + 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 "[ FAIL ] Do NOT run this script as root!" + exit 1 + fi + elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + echo "[ FAIL ] Do NOT run this script as root!" + exit 1 + else + core_functions.sh + check_root.sh + fi +fi + +# Download the latest serverlist. This is the complete list of all supported servers. +fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" +if [ ! -f "${serverlist}" ]; then + echo "[ FAIL ] serverlist.csv could not be loaded." + exit 1 +fi + +# LinuxGSM installer mode. +if [ "${shortname}" == "core" ]; then + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + { + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' + } | column -s $'\t' -t | more + exit + elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" + fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" + userinput="${result}" + fn_server_info + if [ "${result}" == "${gameservername}" ]; then + fn_install_file + elif [ "${result}" == "" ]; then + echo "Install canceled" + else + echo "[ FAIL ] menu result does not match gameservername" + echo "result: ${result}" + echo "gameservername: ${gameservername}" + fi + elif [ -n "${userinput}" ]; then + fn_server_info + if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + fn_install_file + else + echo "[ FAIL ] unknown game server" + fi + else + fn_install_getopt + fi + +# LinuxGSM server mode. +else + core_functions.sh + if [ "${shortname}" != "core-dep" ]; then + # Load LinuxGSM configs. + # These are required to get all the default variables for the specific server. + # Load the default config. If missing download it. If changed reload it. + if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then + mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" + fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + fi + if [ ! -f "${configdirserver}/_default.cfg" ]; then + mkdir -p "${configdirserver}" + echo -en " copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + else + function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${function_file_diff}" != "" ]; then + fn_print_warn_nl "_default.cfg has been altered. reloading config." + echo -en " copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + fi + fi + source "${configdirserver}/_default.cfg" + # Load the common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/common.cfg" + else + source "${configdirserver}/common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/${servicename}.cfg" + else + source "${configdirserver}/${servicename}.cfg" + fi + + # Load the linuxgsm.sh in to tmpdir. If missing download it. + if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" + fi + 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_fctrserver.sh b/tests/tests_fctrserver.sh new file mode 100644 index 000000000..ca4bf150f --- /dev/null +++ b/tests/tests_fctrserver.sh @@ -0,0 +1,1018 @@ +#!/bin/bash +# Project: Game Server Managers - LinuxGSM +# Author: Daniel Gibbs +# License: MIT License, Copyright (c) 2019 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 + +travistest="1" +version="v19.6.0" +shortname="fctr" +gameservername="fctrserver" +rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +servicename="${gameservername}" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/lgsm" +steamcmddir="${rootdir}/steamcmd" +serverfiles="${rootdir}/serverfiles" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" +tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +serverlist="${datadir}/serverlist.csv" +serverlistmenu="${datadir}/serverlistmenu.csv" +configdir="${lgsmdir}/config-lgsm" +configdirserver="${configdir}/${gameservername}" +configdirdefault="${lgsmdir}/config-default" +userinput="${1}" + +# Allows for testing not on Travis CI +if [ ! -v TRAVIS ]; then + TRAVIS_BRANCH="develop" + TRAVIS_BUILD_DIR="${rootdir}" +fi + +## 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}" + fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +} + +# Bootstrap +# Fetches the core functions required before passed off to core_dl.sh. + +# Fetches core functions. +fn_bootstrap_fetch_file(){ + remote_fileurl="${1}" + local_filedir="${2}" + local_filename="${3}" + chmodx="${4:-0}" + run="${5:-0}" + forcedl="${6:-0}" + md5="${7:-0}" + # Download file if missing or download forced. + if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + if [ ! -d "${local_filedir}" ]; then + mkdir -p "${local_filedir}" + fi + # Defines curl path. + curlpath=$(command -v curl 2>/dev/null) + + # If curl exists download file. + if [ "$(basename "${curlpath}")" == "curl" ]; then + # Trap to remove part downloaded files. + echo -en " fetching ${local_filename}...\c" + curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1) + local exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + if [ -f "${lgsmlog}" ]; then + echo -e "${remote_fileurl}" | tee -a "${lgsmlog}" + echo "${curlcmd}" | tee -a "${lgsmlog}" + fi + exit 1 + else + echo -e "OK" + fi + else + echo "[ FAIL ] Curl is not installed" + exit 1 + fi + # Make file chmodx if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" + fi + fi + + if [ -f "${local_filedir}/${local_filename}" ]; then + # Run file if run is set. + if [ "${run}" == "run" ]; then + source "${local_filedir}/${local_filename}" + fi + fi +} + +fn_bootstrap_fetch_file_github(){ + github_file_url_dir="${1}" + github_file_url_name="${2}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + + remote_fileurl="${githuburl}" + 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}" "${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(){ + char="${1:-=}" + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "${char}" +} + +# 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 "${line}" | awk -F "," '{print $2 " - " $3}') + menu_options+=( "${var}" ) + done < ${options} + menu_options+=( "Cancel" ) + select option in "${menu_options[@]}"; do + if [ -n "${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 "${line}" | awk -F "," '{print $3}') + val=$(echo "${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 [ -x "$(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 "Usage: $0 [option]" + echo -e "" + echo "Installer - Linux Game Server Managers - Version ${version}" + echo "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 + let 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 "Installed ${gamename} server as ${local_filename}" + echo "" + if [ ! -d "${serverfiles}" ]; then + echo "./${local_filename} install" + else + echo "Remember to check server ports" + echo "./${local_filename} details" + fi + echo "" + 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 "[ FAIL ] Do NOT run this script as root!" + exit 1 + fi + elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + echo "[ FAIL ] Do NOT run this script as root!" + exit 1 + else + core_functions.sh + check_root.sh + fi +fi + +# Download the latest serverlist. This is the complete list of all supported servers. +fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" +if [ ! -f "${serverlist}" ]; then + echo "[ FAIL ] serverlist.csv could not be loaded." + exit 1 +fi + +# LinuxGSM installer mode. +if [ "${shortname}" == "core" ]; then + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + { + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' + } | column -s $'\t' -t | more + exit + elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" + fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" + userinput="${result}" + fn_server_info + if [ "${result}" == "${gameservername}" ]; then + fn_install_file + elif [ "${result}" == "" ]; then + echo "Install canceled" + else + echo "[ FAIL ] menu result does not match gameservername" + echo "result: ${result}" + echo "gameservername: ${gameservername}" + fi + elif [ -n "${userinput}" ]; then + fn_server_info + if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + fn_install_file + else + echo "[ FAIL ] unknown game server" + fi + else + fn_install_getopt + fi + +# LinuxGSM server mode. +else + core_functions.sh + if [ "${shortname}" != "core-dep" ]; then + # Load LinuxGSM configs. + # These are required to get all the default variables for the specific server. + # Load the default config. If missing download it. If changed reload it. + if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then + mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" + fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + fi + if [ ! -f "${configdirserver}/_default.cfg" ]; then + mkdir -p "${configdirserver}" + echo -en " copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + else + function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${function_file_diff}" != "" ]; then + fn_print_warn_nl "_default.cfg has been altered. reloading config." + echo -en " copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + fi + fi + source "${configdirserver}/_default.cfg" + # Load the common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/common.cfg" + else + source "${configdirserver}/common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/${servicename}.cfg" + else + source "${configdirserver}/${servicename}.cfg" + fi + + # Load the linuxgsm.sh in to tmpdir. If missing download it. + if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" + fi + 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_currentstatus_ts3(){ + check_status.sh + if [ "${status}" != "0" ]; then + currentstatus="ONLINE" + else + currentstatus="OFFLINE" + fi +} + +fn_setstatus(){ + fn_currentstatus_tmux + echo"" + echo "Required status: ${requiredstatus}" + counter=0 + echo "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 "Current status: ${currentstatus}" + echo "" + echo "Unable to start or stop server." + exit 1 + fi + done + echo -en "New status: ${currentstatus}\\r" + echo -e "\n" + echo "Test starting:" + echo "" +} + +# 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 "=================================" + echo "Expected result: PASS" + echo "Actual result: FAIL" + fn_print_fail_nl "TEST FAILED" + exitcode=1 + core_exit.sh + else + echo "=================================" + echo "Expected result: PASS" + echo "Actual result: PASS" + fn_print_ok_nl "TEST PASSED" + echo "" + fi +} + +# if expecting a fail +fn_test_result_fail(){ + if [ $? == 0 ]; then + echo "=================================" + echo "Expected result: FAIL" + echo "Actual result: PASS" + fn_print_fail_nl "TEST FAILED" + exitcode=1 + core_exit.sh + else + echo "=================================" + echo "Expected result: FAIL" + echo "Actual result: FAIL" + fn_print_ok_nl "TEST PASSED" + echo "" + fi +} + +# test result n/a +fn_test_result_na(){ + echo "=================================" + echo "Expected result: N/A" + echo "Actual result: N/A" + fn_print_fail_nl "TEST N/A" +} + +echo "=================================" +echo "Travis CI Tests" +echo "Linux Game Server Manager" +echo "by Daniel Gibbs" +echo "Contributors: http://goo.gl/qLmitD" +echo "https://linuxgsm.com" +echo "=================================" +echo "" +echo "=================================" +echo "Server Tests" +echo "Using: ${gamename}" +echo "Testing Branch: $TRAVIS_BRANCH" +echo "=================================" + +echo "" +echo "0.0 - Pre-test Tasks" +echo "==================================================================" +echo "Description:" +echo "Create log dir's" +echo "" + +echo "" +echo "0.1 - Create log dir's" +echo "=================================" +echo "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + install_logs.sh +) +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "0.2 - Enable dev-debug" +echo "=================================" +echo "Description:" +echo "Enable dev-debug" +echo "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_debug.sh +) +fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "1.0 - Pre-install tests" +echo "==================================================================" +echo "" + +echo "1.1 - start - no files" +echo "=================================" +echo "Description:" +echo "test script reaction to missing server files." +echo "Command: ./${gameservername} start" +echo "" +# Allows for testing not on Travis CI +if [ ! -v TRAVIS ]; then +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_fail +else + echo "Test bypassed" +fi + +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "1.2 - getopt" +echo "=================================" +echo "Description:" +echo "displaying options messages." +echo "Command: ./${gameservername}" +echo "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) +fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "1.3 - getopt with incorrect args" +echo "=================================" +echo "Description:" +echo "displaying options messages." +echo "Command: ./${gameservername} abc123" +echo "" +getopt="abc123" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) +fn_test_result_fail +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "2.0 - Installation" +echo "==================================================================" + +echo "" +echo "2.0 - install" +echo "=================================" +echo "Description:" +echo "install ${gamename} server." +echo "Command: ./${gameservername} auto-install" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + fn_autoinstall +) +fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "3.0 - Start/Stop/Restart Tests" +echo "==================================================================" + +echo "" +echo "3.1 - start" +echo "=================================" +echo "Description:" +echo "start ${gamename} server." +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "3.2 - start - online" +echo "=================================" +echo "Description:" +echo "start ${gamename} server while already running." +echo "Command: ./${gameservername} start" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "3.3 - start - updateonstart" +echo "=================================" +echo "Description:" +echo "will update server on start." +echo "Command: ./${gameservername} start" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "3.4 - stop" +echo "=================================" +echo "Description:" +echo "stop ${gamename} server." +echo "Command: ./${gameservername} stop" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "3.5 - stop - offline" +echo "=================================" +echo "Description:" +echo "stop ${gamename} server while already stopped." +echo "Command: ./${gameservername} stop" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "3.6 - restart" +echo "=================================" +echo "Description:" +echo "restart ${gamename}." +echo "Command: ./${gameservername} restart" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "3.7 - restart - offline" +echo "=================================" +echo "Description:" +echo "restart ${gamename} while already stopped." +echo "Command: ./${gameservername} restart" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "4.0 - Update Tests" +echo "==================================================================" + +echo "" +echo "4.1 - update" +echo "=================================" +echo "Description:" +echo "check for updates." +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "5.0 - Monitor Tests" +echo "==================================================================" + +echo "" +echo "Server IP - Port: ${ip}:${port}" +echo "Server IP - Query Port: ${ip}:${queryport}" + +echo "" +echo "5.1 - monitor - online" +echo "=================================" +echo "Description:" +echo "run monitor server while already running." +echo "Command: ./${gameservername} monitor" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "5.2 - monitor - offline - with lockfile" +echo "=================================" +echo "Description:" +echo "run monitor while server is offline with lockfile." +echo "Command: ./${gameservername} monitor" +requiredstatus="OFFLINE" +fn_setstatus +fn_print_info_nl "creating lockfile." +date '+%s' > "${rootdir}/${lockselfname}" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "5.3 - monitor - offline - no lockfile" +echo "=================================" +echo "Description:" +echo "run monitor while server is offline with no lockfile." +echo "Command: ./${gameservername} monitor" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "5.4 - test-alert" +echo "=================================" +echo "Description:" +echo "run monitor while server is offline with no lockfile." +echo "Command: ./${gameservername} test-alert" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "6.0 - Details Tests" +echo "==================================================================" + +echo "" +echo "6.1 - details" +echo "=================================" +echo "Description:" +echo "display details." +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "6.2 - postdetails" +echo "=================================" +echo "Description:" +echo "post details." +echo "Command: ./${gameservername} postdetails" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "7.0 - Backup Tests" +echo "==================================================================" + +echo "" +echo "7.1 - backup" +echo "=================================" +echo "Description:" +echo "run a backup." +echo "Command: ./${gameservername} backup" +requiredstatus="ONLINE" +fn_setstatus +echo "test de-activated until issue #1839 fixed" +#(command_backup.sh) +fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.0 - Development Tools Tests" +echo "==================================================================" + +echo "" +echo "8.1 - dev - detect glibc" +echo "=================================" +echo "Description:" +echo "detect glibc." +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.2 - dev - detect ldd" +echo "=================================" +echo "Description:" +echo "detect ldd." +echo "Command: ./${gameservername} detect-ldd" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.3 - dev - detect deps" +echo "=================================" +echo "Description:" +echo "detect dependencies." +echo "Command: ./${gameservername} detect-deps" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.4 - dev - query-raw" +echo "=================================" +echo "Description:" +echo "raw query output." +echo "Command: ./${gameservername} query-raw" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "=================================" +echo "Server Tests - Complete!" +echo "Using: ${gamename}" +echo "=================================" +requiredstatus="OFFLINE" +fn_setstatus +fn_print_info "Tidying up directories." +rm -rfv "${serverfiles}" +core_exit.sh diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index c4d46cbcb..dbcca9b42 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -1,14 +1,17 @@ #!/bin/bash -# Just Cause 2 # Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2016 Daniel Gibbs -# Purpose: TravisCI Test: Just Cause 2 | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -travistest=1 +# License: MIT License, Copyright (c) 2019 Daniel Gibbs +# Purpose: Travis CI Tests: Just Cause 2 | Linux Game Server Management Script +# Contributors: https://linuxgsm.com/contrib +# Documentation: https://docs.linuxgsm.com +# Website: https://linuxgsm.com + +# DO NOT EDIT THIS FILE +# LinuxGSM configuration is no longer edited here +# To update your LinuxGSM config go to: +# lgsm/config-lgsm +# https://docs.linuxgsm.com/configuration/linuxgsm-config # Debugging if [ -f ".dev-debug" ]; then @@ -17,171 +20,259 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" - -########################## -######## Settings ######## -########################## +travistest="1" +version="v19.6.0" +shortname="jc2" +gameservername="jc2server" +rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +servicename="${gameservername}" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/lgsm" +steamcmddir="${rootdir}/steamcmd" +serverfiles="${rootdir}/serverfiles" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" +tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +serverlist="${datadir}/serverlist.csv" +serverlistmenu="${datadir}/serverlistmenu.csv" +configdir="${lgsmdir}/config-lgsm" +configdirserver="${configdir}/${gameservername}" +configdirdefault="${lgsmdir}/config-default" +userinput="${1}" + +# Allows for testing not on Travis CI +if [ ! -v TRAVIS ]; then + TRAVIS_BRANCH="develop" + TRAVIS_BUILD_DIR="${rootdir}" +fi -#### Server Settings #### -# No settings available for Just Cause 2 +## 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}" -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="" +# Core function that is required first. +core_functions.sh(){ + functionfile="${FUNCNAME}" + fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" } -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" +# Bootstrap +# Fetches the core functions required before passed off to core_dl.sh. + +# Fetches core functions. +fn_bootstrap_fetch_file(){ + remote_fileurl="${1}" + local_filedir="${2}" + local_filename="${3}" + chmodx="${4:-0}" + run="${5:-0}" + forcedl="${6:-0}" + md5="${7:-0}" + # Download file if missing or download forced. + if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + if [ ! -d "${local_filedir}" ]; then + mkdir -p "${local_filedir}" + fi + # Defines curl path. + curlpath=$(command -v curl 2>/dev/null) + + # If curl exists download file. + if [ "$(basename "${curlpath}")" == "curl" ]; then + # Trap to remove part downloaded files. + echo -en " fetching ${local_filename}...\c" + curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1) + local exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + if [ -f "${lgsmlog}" ]; then + echo -e "${remote_fileurl}" | tee -a "${lgsmlog}" + echo "${curlcmd}" | tee -a "${lgsmlog}" + fi + exit 1 + else + echo -e "OK" + fi + else + echo "[ FAIL ] Curl is not installed" + exit 1 + fi + # Make file chmodx if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" + fi + fi -#### LinuxGSM Advanced Settings #### + if [ -f "${local_filedir}/${local_filename}" ]; then + # Run file if run is set. + if [ "${run}" == "run" ]; then + source "${local_filedir}/${local_filename}" + fi + fi +} -## SteamCMD Settings -# Server appid -appid="261140" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" +fn_bootstrap_fetch_file_github(){ + github_file_url_dir="${1}" + github_file_url_name="${2}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + + remote_fileurl="${githuburl}" + 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}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" +} -## 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" +# Installer menu. -## LinuxGSM Server Details -# Do not edit -gamename="Just Cause 2" -engine="avalanche" +fn_print_center() { + columns="$(tput cols)" + line="$@" + printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" +} -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="jc2-server" +fn_print_horizontal(){ + char="${1:-=}" + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "${char}" +} -#### Directories #### -# Edit with care +# 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 "${line}" | awk -F "," '{print $2 " - " $3}') + menu_options+=( "${var}" ) + done < ${options} + menu_options+=( "Cancel" ) + select option in "${menu_options[@]}"; do + if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then + eval "$resultvar=\"${option/%\ */}\"" + fi + break + done +} -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./Jcmp-Server" -servercfg="config.lua" -servercfgdefault="config.lua" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -#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" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" +# 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 "${line}" | awk -F "," '{print $3}') + val=$(echo "${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 - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then +} + +# 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 [ -x "$(command -v "${menucmd}")" ]; then + menucmd=$(command -v "${menucmd}") break fi done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" + 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}\"" } -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl +# 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 } -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl +fn_install_getopt(){ + userinput="empty" + echo "Usage: $0 [option]" + echo -e "" + echo "Installer - Linux Game Server Managers - Version ${version}" + echo "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 } -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then +fn_install_file(){ + local_filename="${gameservername}" + if [ -e "${local_filename}" ]; then + i=2 + while [ -e "${local_filename}-${i}" ] ; do + let 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 "Installed ${gamename} server as ${local_filename}" + echo "" + if [ ! -d "${serverfiles}" ]; then + echo "./${local_filename} install" + else + echo "Remember to check server ports" + echo "./${local_filename} details" + fi + echo "" + 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 "[ FAIL ] Do NOT run this script as root!" + exit 1 + fi + elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then echo "[ FAIL ] Do NOT run this script as root!" exit 1 else @@ -190,8 +281,111 @@ if [ "$(whoami)" = "root" ]; then fi fi -core_dl.sh -core_functions.sh +# Download the latest serverlist. This is the complete list of all supported servers. +fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" +if [ ! -f "${serverlist}" ]; then + echo "[ FAIL ] serverlist.csv could not be loaded." + exit 1 +fi + +# LinuxGSM installer mode. +if [ "${shortname}" == "core" ]; then + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + { + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' + } | column -s $'\t' -t | more + exit + elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" + fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" + userinput="${result}" + fn_server_info + if [ "${result}" == "${gameservername}" ]; then + fn_install_file + elif [ "${result}" == "" ]; then + echo "Install canceled" + else + echo "[ FAIL ] menu result does not match gameservername" + echo "result: ${result}" + echo "gameservername: ${gameservername}" + fi + elif [ -n "${userinput}" ]; then + fn_server_info + if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + fn_install_file + else + echo "[ FAIL ] unknown game server" + fi + else + fn_install_getopt + fi + +# LinuxGSM server mode. +else + core_functions.sh + if [ "${shortname}" != "core-dep" ]; then + # Load LinuxGSM configs. + # These are required to get all the default variables for the specific server. + # Load the default config. If missing download it. If changed reload it. + if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then + mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" + fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + fi + if [ ! -f "${configdirserver}/_default.cfg" ]; then + mkdir -p "${configdirserver}" + echo -en " copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + else + function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${function_file_diff}" != "" ]; then + fn_print_warn_nl "_default.cfg has been altered. reloading config." + echo -en " copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + fi + fi + source "${configdirserver}/_default.cfg" + # Load the common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/common.cfg" + else + source "${configdirserver}/common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/${servicename}.cfg" + else + source "${configdirserver}/${servicename}.cfg" + fi + + # Load the linuxgsm.sh in to tmpdir. If missing download it. + if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" + fi + 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 @@ -220,7 +414,7 @@ fn_setstatus(){ while [ "${requiredstatus}" != "${currentstatus}" ]; do counter=$((counter+1)) fn_currentstatus_tmux - echo -ne "New status: ${currentstatus}\\r" + echo -en "New status: ${currentstatus}\\r" if [ "${requiredstatus}" == "ONLINE" ]; then (command_start.sh > /dev/null 2>&1) @@ -235,16 +429,15 @@ fn_setstatus(){ exit 1 fi done - echo -ne "New status: ${currentstatus}\\r" + echo -en "New status: ${currentstatus}\\r" echo -e "\n" echo "Test starting:" echo "" - sleep 0.5 } # 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 excpecting a pass +# if expecting a pass fn_test_result_pass(){ if [ $? != 0 ]; then echo "=================================" @@ -262,7 +455,7 @@ fn_test_result_pass(){ fi } -# if excpecting a fail +# if expecting a fail fn_test_result_fail(){ if [ $? == 0 ]; then echo "=================================" @@ -280,11 +473,20 @@ fn_test_result_fail(){ fi } +# test result n/a +fn_test_result_na(){ + echo "=================================" + echo "Expected result: N/A" + echo "Actual result: N/A" + fn_print_fail_nl "TEST N/A" +} + echo "=================================" -echo "TravisCI Tests" +echo "Travis CI Tests" echo "Linux Game Server Manager" echo "by Daniel Gibbs" -echo "https://gameservermanagers.com" +echo "Contributors: http://goo.gl/qLmitD" +echo "https://linuxgsm.com" echo "=================================" echo "" echo "=================================" @@ -292,150 +494,290 @@ echo "Server Tests" echo "Using: ${gamename}" echo "Testing Branch: $TRAVIS_BRANCH" echo "=================================" -echo "" -echo "0.1 - Create log dir's" -echo "=================================" +echo "" +echo "0.0 - Pre-test Tasks" +echo "==================================================================" echo "Description:" echo "Create log dir's" echo "" -(install_logs.sh) +echo "" +echo "0.1 - Create log dir's" +echo "=================================" +echo "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + install_logs.sh +) +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo "" echo "0.2 - Enable dev-debug" echo "=================================" echo "Description:" echo "Enable dev-debug" echo "" -(command_dev_debug.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_debug.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "1.0 - Pre-install tests" +echo "==================================================================" +echo "" -echo "1.0 - start - no files" +echo "1.1 - start - no files" echo "=================================" echo "Description:" echo "test script reaction to missing server files." -echo "Command: ./jc2server start" +echo "Command: ./${gameservername} start" echo "" -(command_start.sh) +# Allows for testing not on Travis CI +if [ ! -v TRAVIS ]; then +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) fn_test_result_fail +else + echo "Test bypassed" +fi + +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" -echo "1.1 - getopt" +echo "1.2 - getopt" echo "=================================" echo "Description:" echo "displaying options messages." -echo "Command: ./jc2server" +echo "Command: ./${gameservername}" echo "" -(core_getopt.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" -echo "1.2 - getopt with incorrect args" +echo "1.3 - getopt with incorrect args" echo "=================================" echo "Description:" echo "displaying options messages." -echo "Command: ./jc2server abc123" +echo "Command: ./${gameservername} abc123" echo "" getopt="abc123" -(core_getopt.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) fn_test_result_fail +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "2.0 - Installation" +echo "==================================================================" echo "" echo "2.0 - install" echo "=================================" echo "Description:" echo "install ${gamename} server." -echo "Command: ./jc2server auto-install" -(fn_autoinstall) +echo "Command: ./${gameservername} auto-install" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + fn_autoinstall +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo "" +echo "3.0 - Start/Stop/Restart Tests" +echo "==================================================================" echo "" echo "3.1 - start" echo "=================================" echo "Description:" echo "start ${gamename} server." -echo "Command: ./jc2server start" +echo "Command: ./${gameservername} start" requiredstatus="OFFLINE" fn_setstatus -(command_start.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "3.2 - start - online" echo "=================================" echo "Description:" echo "start ${gamename} server while already running." -echo "Command: ./jc2server start" +echo "Command: ./${gameservername} start" requiredstatus="ONLINE" fn_setstatus -(command_start.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) fn_test_result_fail +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "3.3 - start - updateonstart" echo "=================================" echo "Description:" echo "will update server on start." -echo "Command: ./jc2server start" +echo "Command: ./${gameservername} start" requiredstatus="OFFLINE" fn_setstatus -(updateonstart="on";command_start.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + updateonstart="on";command_start.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "3.4 - stop" echo "=================================" echo "Description:" echo "stop ${gamename} server." -echo "Command: ./jc2server stop" +echo "Command: ./${gameservername} stop" requiredstatus="ONLINE" fn_setstatus -(command_stop.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_stop.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "3.5 - stop - offline" echo "=================================" echo "Description:" echo "stop ${gamename} server while already stopped." -echo "Command: ./jc2server stop" +echo "Command: ./${gameservername} stop" requiredstatus="OFFLINE" fn_setstatus -(command_stop.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_stop.sh +) fn_test_result_fail +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "3.6 - restart" echo "=================================" echo "Description:" echo "restart ${gamename}." -echo "Command: ./jc2server restart" +echo "Command: ./${gameservername} restart" requiredstatus="ONLINE" fn_setstatus -(command_restart.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_restart.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "3.7 - restart - offline" echo "=================================" echo "Description:" echo "restart ${gamename} while already stopped." -echo "Command: ./jc2server restart" +echo "Command: ./${gameservername} restart" requiredstatus="OFFLINE" fn_setstatus -(command_restart.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_restart.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo "" +echo "4.0 - Update Tests" +echo "==================================================================" + +echo "" echo "4.1 - update" echo "=================================" echo "Description:" echo "check for updates." -echo "Command: ./jc2server update" +echo "Command: ./${gameservername} update" requiredstatus="OFFLINE" fn_setstatus -(command_update.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "4.2 - update - change buildid" @@ -446,9 +788,17 @@ echo "Command: ./jc2server update" requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "changed buildid to 0." -sed -i 's/[0-9]\+/0/' "${filesdir}/steamapps/appmanifest_${appid}.acf" -(command_update.sh) +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "4.3 - update - change buildid - online" @@ -459,9 +809,17 @@ echo "Command: ./jc2server update" requiredstatus="ONLINE" fn_setstatus fn_print_info_nl "changed buildid to 0." -sed -i 's/[0-9]\+/0/' "${filesdir}/steamapps/appmanifest_${appid}.acf" -(command_update.sh) +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "4.4 - update - remove appmanifest file" @@ -472,9 +830,17 @@ echo "Command: ./jc2server update" requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "removed appmanifest_${appid}.acf." -rm --verbose "${filesdir}/steamapps/appmanifest_${appid}.acf" -(command_update.sh) +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "4.5 - force-update" @@ -484,8 +850,16 @@ echo "force-update bypassing update check." echo "Command: ./jc2server force-update" requiredstatus="OFFLINE" fn_setstatus -(forceupdate=1;command_update.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + forceupdate=1;command_update.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "4.6 - force-update - online" @@ -495,8 +869,16 @@ echo "force-update bypassing update check server while already running." echo "Command: ./jc2server force-update" requiredstatus="ONLINE" fn_setstatus -(forceupdate=1;command_update.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + forceupdate=1;command_update.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "4.7 - validate" @@ -506,8 +888,16 @@ echo "validate server files." echo "Command: ./jc2server validate" requiredstatus="OFFLINE" fn_setstatus -(command_validate.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_validate.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "4.8 - validate - online" @@ -518,84 +908,263 @@ echo "" echo "Command: ./jc2server validate" requiredstatus="ONLINE" fn_setstatus -(command_validate.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_validate.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" -echo "4.9 - update-functions" +echo "Inserting IP address" echo "=================================" echo "Description:" -echo "runs update-functions." +echo "Inserting Travis IP in to config." +echo "Allows monitor to work" +if [ "$(ip -o -4 addr|grep eth0)" ]; then + travisip=$(ip -o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0) +else + travisip=$(ip -o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) +fi +sed -i "/BindIP/c\BindIP = \"${travisip}\"," "${serverfiles}/config.lua" +echo "IP: ${travisip}" + echo "" -echo "Command: ./jc2server update-functions" -requiredstatus="OFFLINE" -fn_setstatus -(command_update_functions.sh) -fn_test_result_pass +echo "5.0 - Monitor Tests" +echo "==================================================================" +echo "" +echo "Server IP - Port: ${ip}:${port}" +echo "Server IP - Query Port: ${ip}:${queryport}" echo "" echo "5.1 - monitor - online" echo "=================================" echo "Description:" echo "run monitor server while already running." -echo "Command: ./jc2server monitor" +echo "Command: ./${gameservername} monitor" requiredstatus="ONLINE" fn_setstatus -(command_monitor.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) fn_test_result_pass - +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "5.2 - monitor - offline - with lockfile" echo "=================================" echo "Description:" echo "run monitor while server is offline with lockfile." -echo "Command: ./jc2server monitor" +echo "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." -date > "${rootdir}/${lockselfname}" -(command_monitor.sh) +date '+%s' > "${rootdir}/${lockselfname}" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) fn_test_result_pass - +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "5.3 - monitor - offline - no lockfile" echo "=================================" echo "Description:" echo "run monitor while server is offline with no lockfile." -echo "Command: ./jc2server monitor" +echo "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus -(command_monitor.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) fn_test_result_fail +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" -echo "5.4 - monitor - gsquery.py failure" +echo "5.4 - test-alert" echo "=================================" echo "Description:" -echo "gsquery.py will fail to query port." -echo "Command: ./jc2server monitor" -requiredstatus="ONLINE" +echo "run monitor while server is offline with no lockfile." +echo "Command: ./${gameservername} test-alert" +requiredstatus="OFFLINE" fn_setstatus +cp "${servercfgfullpath}" "config.lua" sed -i 's/[0-9]\+/0/' "${servercfgfullpath}" -(command_monitor.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_test_alert.sh +) fn_test_result_fail +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + echo "" fn_print_info_nl "Re-generating ${servercfg}." -install_config.sh +cp -v "config.lua" "${servercfgfullpath}" echo "=================================" echo "" -echo "6.0 - details" +echo "6.0 - Details Tests" +echo "==================================================================" + +echo "" +echo "6.1 - details" echo "=================================" echo "Description:" echo "display details." -echo "Command: ./jc2server details" +echo "Command: ./${gameservername} details" requiredstatus="ONLINE" fn_setstatus -(command_details.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_details.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "6.2 - postdetails" +echo "=================================" +echo "Description:" +echo "post details." +echo "Command: ./${gameservername} postdetails" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "7.0 - Backup Tests" +echo "==================================================================" + +echo "" +echo "7.1 - backup" +echo "=================================" +echo "Description:" +echo "run a backup." +echo "Command: ./${gameservername} backup" +requiredstatus="ONLINE" +fn_setstatus +echo "test de-activated until issue #1839 fixed" +#(command_backup.sh) +fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.0 - Development Tools Tests" +echo "==================================================================" + +echo "" +echo "8.1 - dev - detect glibc" +echo "=================================" +echo "Description:" +echo "detect glibc." +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.2 - dev - detect ldd" +echo "=================================" +echo "Description:" +echo "detect ldd." +echo "Command: ./${gameservername} detect-ldd" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.3 - dev - detect deps" +echo "=================================" +echo "Description:" +echo "detect dependencies." +echo "Command: ./${gameservername} detect-deps" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.4 - dev - query-raw" +echo "=================================" +echo "Description:" +echo "raw query output." +echo "Command: ./${gameservername} query-raw" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "=================================" @@ -604,8 +1173,6 @@ echo "Using: ${gamename}" echo "=================================" requiredstatus="OFFLINE" fn_setstatus -sleep 1 fn_print_info "Tidying up directories." -sleep 1 rm -rfv "${serverfiles}" core_exit.sh diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh new file mode 100644 index 000000000..426851163 --- /dev/null +++ b/tests/tests_mcserver.sh @@ -0,0 +1,1064 @@ +#!/bin/bash +# Project: Game Server Managers - LinuxGSM +# Author: Daniel Gibbs +# License: MIT License, Copyright (c) 2019 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 + +travistest="1" +version="v19.6.0" +shortname="mc" +gameservername="mcserver" +rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +servicename="${gameservername}" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/lgsm" +steamcmddir="${rootdir}/steamcmd" +serverfiles="${rootdir}/serverfiles" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" +tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +serverlist="${datadir}/serverlist.csv" +serverlistmenu="${datadir}/serverlistmenu.csv" +configdir="${lgsmdir}/config-lgsm" +configdirserver="${configdir}/${gameservername}" +configdirdefault="${lgsmdir}/config-default" +userinput="${1}" + +# Allows for testing not on Travis CI +if [ ! -v TRAVIS ]; then + TRAVIS_BRANCH="develop" + TRAVIS_BUILD_DIR="${rootdir}" +fi + +## 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}" + fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +} + +# Bootstrap +# Fetches the core functions required before passed off to core_dl.sh. + +# Fetches core functions. +fn_bootstrap_fetch_file(){ + remote_fileurl="${1}" + local_filedir="${2}" + local_filename="${3}" + chmodx="${4:-0}" + run="${5:-0}" + forcedl="${6:-0}" + md5="${7:-0}" + # Download file if missing or download forced. + if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + if [ ! -d "${local_filedir}" ]; then + mkdir -p "${local_filedir}" + fi + # Defines curl path. + curlpath=$(command -v curl 2>/dev/null) + + # If curl exists download file. + if [ "$(basename "${curlpath}")" == "curl" ]; then + # Trap to remove part downloaded files. + echo -en " fetching ${local_filename}...\c" + curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1) + local exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + if [ -f "${lgsmlog}" ]; then + echo -e "${remote_fileurl}" | tee -a "${lgsmlog}" + echo "${curlcmd}" | tee -a "${lgsmlog}" + fi + exit 1 + else + echo -e "OK" + fi + else + echo "[ FAIL ] Curl is not installed" + exit 1 + fi + # Make file chmodx if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" + fi + fi + + if [ -f "${local_filedir}/${local_filename}" ]; then + # Run file if run is set. + if [ "${run}" == "run" ]; then + source "${local_filedir}/${local_filename}" + fi + fi +} + +fn_bootstrap_fetch_file_github(){ + github_file_url_dir="${1}" + github_file_url_name="${2}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + + remote_fileurl="${githuburl}" + 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}" "${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(){ + char="${1:-=}" + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "${char}" +} + +# 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 "${line}" | awk -F "," '{print $2 " - " $3}') + menu_options+=( "${var}" ) + done < ${options} + menu_options+=( "Cancel" ) + select option in "${menu_options[@]}"; do + if [ -n "${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 "${line}" | awk -F "," '{print $3}') + val=$(echo "${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 [ -x "$(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 "Usage: $0 [option]" + echo -e "" + echo "Installer - Linux Game Server Managers - Version ${version}" + echo "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 + let 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 "Installed ${gamename} server as ${local_filename}" + echo "" + if [ ! -d "${serverfiles}" ]; then + echo "./${local_filename} install" + else + echo "Remember to check server ports" + echo "./${local_filename} details" + fi + echo "" + 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 "[ FAIL ] Do NOT run this script as root!" + exit 1 + fi + elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + echo "[ FAIL ] Do NOT run this script as root!" + exit 1 + else + core_functions.sh + check_root.sh + fi +fi + +# Download the latest serverlist. This is the complete list of all supported servers. +fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" +if [ ! -f "${serverlist}" ]; then + echo "[ FAIL ] serverlist.csv could not be loaded." + exit 1 +fi + +# LinuxGSM installer mode. +if [ "${shortname}" == "core" ]; then + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + { + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' + } | column -s $'\t' -t | more + exit + elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" + fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" + userinput="${result}" + fn_server_info + if [ "${result}" == "${gameservername}" ]; then + fn_install_file + elif [ "${result}" == "" ]; then + echo "Install canceled" + else + echo "[ FAIL ] menu result does not match gameservername" + echo "result: ${result}" + echo "gameservername: ${gameservername}" + fi + elif [ -n "${userinput}" ]; then + fn_server_info + if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + fn_install_file + else + echo "[ FAIL ] unknown game server" + fi + else + fn_install_getopt + fi + +# LinuxGSM server mode. +else + core_functions.sh + if [ "${shortname}" != "core-dep" ]; then + # Load LinuxGSM configs. + # These are required to get all the default variables for the specific server. + # Load the default config. If missing download it. If changed reload it. + if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then + mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" + fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + fi + if [ ! -f "${configdirserver}/_default.cfg" ]; then + mkdir -p "${configdirserver}" + echo -en " copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + else + function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${function_file_diff}" != "" ]; then + fn_print_warn_nl "_default.cfg has been altered. reloading config." + echo -en " copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + fi + fi + source "${configdirserver}/_default.cfg" + # Load the common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/common.cfg" + else + source "${configdirserver}/common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/${servicename}.cfg" + else + source "${configdirserver}/${servicename}.cfg" + fi + + # Load the linuxgsm.sh in to tmpdir. If missing download it. + if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" + fi + 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_currentstatus_ts3(){ + check_status.sh + if [ "${status}" != "0" ]; then + currentstatus="ONLINE" + else + currentstatus="OFFLINE" + fi +} + +fn_setstatus(){ + fn_currentstatus_tmux + echo"" + echo "Required status: ${requiredstatus}" + counter=0 + echo "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 "Current status: ${currentstatus}" + echo "" + echo "Unable to start or stop server." + exit 1 + fi + done + echo -en "New status: ${currentstatus}\\r" + echo -e "\n" + echo "Test starting:" + echo "" +} + +# 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 "=================================" + echo "Expected result: PASS" + echo "Actual result: FAIL" + fn_print_fail_nl "TEST FAILED" + exitcode=1 + core_exit.sh + else + echo "=================================" + echo "Expected result: PASS" + echo "Actual result: PASS" + fn_print_ok_nl "TEST PASSED" + echo "" + fi +} + +# if expecting a fail +fn_test_result_fail(){ + if [ $? == 0 ]; then + echo "=================================" + echo "Expected result: FAIL" + echo "Actual result: PASS" + fn_print_fail_nl "TEST FAILED" + exitcode=1 + core_exit.sh + else + echo "=================================" + echo "Expected result: FAIL" + echo "Actual result: FAIL" + fn_print_ok_nl "TEST PASSED" + echo "" + fi +} + +# test result n/a +fn_test_result_na(){ + echo "=================================" + echo "Expected result: N/A" + echo "Actual result: N/A" + fn_print_fail_nl "TEST N/A" +} + +echo "=================================" +echo "Travis CI Tests" +echo "Linux Game Server Manager" +echo "by Daniel Gibbs" +echo "Contributors: http://goo.gl/qLmitD" +echo "https://linuxgsm.com" +echo "=================================" +echo "" +echo "=================================" +echo "Server Tests" +echo "Using: ${gamename}" +echo "Testing Branch: $TRAVIS_BRANCH" +echo "=================================" + +echo "" +echo "0.0 - Pre-test Tasks" +echo "==================================================================" +echo "Description:" +echo "Create log dir's" +echo "" + +echo "" +echo "0.1 - Create log dir's" +echo "=================================" +echo "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + install_logs.sh +) +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "0.2 - Enable dev-debug" +echo "=================================" +echo "Description:" +echo "Enable dev-debug" +echo "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_debug.sh +) +fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "1.0 - Pre-install tests" +echo "==================================================================" +echo "" + +echo "1.1 - start - no files" +echo "=================================" +echo "Description:" +echo "test script reaction to missing server files." +echo "Command: ./${gameservername} start" +echo "" +# Allows for testing not on Travis CI +if [ ! -v TRAVIS ]; then +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_fail +else + echo "Test bypassed" +fi + +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "1.2 - getopt" +echo "=================================" +echo "Description:" +echo "displaying options messages." +echo "Command: ./${gameservername}" +echo "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) +fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "1.3 - getopt with incorrect args" +echo "=================================" +echo "Description:" +echo "displaying options messages." +echo "Command: ./${gameservername} abc123" +echo "" +getopt="abc123" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) +fn_test_result_fail +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "2.0 - Installation" +echo "==================================================================" + +echo "" +echo "2.0 - install" +echo "=================================" +echo "Description:" +echo "install ${gamename} server." +echo "Command: ./${gameservername} auto-install" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + fn_autoinstall +) +fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "3.0 - Start/Stop/Restart Tests" +echo "==================================================================" + +echo "" +echo "3.1 - start" +echo "=================================" +echo "Description:" +echo "start ${gamename} server." +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "3.2 - start - online" +echo "=================================" +echo "Description:" +echo "start ${gamename} server while already running." +echo "Command: ./${gameservername} start" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "3.3 - start - updateonstart" +echo "=================================" +echo "Description:" +echo "will update server on start." +echo "Command: ./${gameservername} start" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo "" +echo "30s Pause" +echo "=================================" +echo "Description:" +echo "give time for server to fully start." +echo "Command: sleep 30" +requiredstatus="ONLINE" +fn_setstatus +sleep 30 + +echo "" +echo "3.4 - stop" +echo "=================================" +echo "Description:" +echo "stop ${gamename} server." +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "3.5 - stop - offline" +echo "=================================" +echo "Description:" +echo "stop ${gamename} server while already stopped." +echo "Command: ./${gameservername} stop" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "3.6 - restart" +echo "=================================" +echo "Description:" +echo "restart ${gamename}." +echo "Command: ./${gameservername} restart" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "3.7 - restart - offline" +echo "=================================" +echo "Description:" +echo "restart ${gamename} while already stopped." +echo "Command: ./${gameservername} restart" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "4.0 - Update Tests" +echo "==================================================================" + +echo "" +echo "4.1 - update" +echo "=================================" +echo "Description:" +echo "check for updates." +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "Inserting IP address" +echo "=================================" +echo "Description:" +echo "Inserting Travis IP in to config." +echo "Allows monitor to work" +if [ "$(ip -o -4 addr|grep eth0)" ]; then + travisip=$(ip -o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0) +else + travisip=$(ip -o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) +fi +sed -i "/server-ip=/c\server-ip=${travisip}" "${serverfiles}/server.properties" +echo "IP: ${travisip}" + +echo "" +echo "5.0 - Monitor Tests" +echo "==================================================================" +echo "" +echo "Server IP - Port: ${ip}:${port}" +echo "Server IP - Query Port: ${ip}:${queryport}" + +echo "" +echo "30s Pause" +echo "=================================" +echo "Description:" +echo "give time for server to fully start." +echo "Command: sleep 30" +requiredstatus="ONLINE" +fn_setstatus +sleep 30 + +echo "" +echo "5.1 - monitor - online" +echo "=================================" +echo "Description:" +echo "run monitor server while already running." +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "5.2 - monitor - offline - with lockfile" +echo "=================================" +echo "Description:" +echo "run monitor while server is offline with lockfile." +echo "Command: ./${gameservername} monitor" +requiredstatus="OFFLINE" +fn_setstatus +fn_print_info_nl "creating lockfile." +date '+%s' > "${rootdir}/${lockselfname}" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "5.3 - monitor - offline - no lockfile" +echo "=================================" +echo "Description:" +echo "run monitor while server is offline with no lockfile." +echo "Command: ./${gameservername} monitor" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "5.4 - test-alert" +echo "=================================" +echo "Description:" +echo "run monitor while server is offline with no lockfile." +echo "Command: ./${gameservername} test-alert" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "6.0 - Details Tests" +echo "==================================================================" + +echo "" +echo "6.1 - details" +echo "=================================" +echo "Description:" +echo "display details." +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "6.2 - postdetails" +echo "=================================" +echo "Description:" +echo "post details." +echo "Command: ./${gameservername} postdetails" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "7.0 - Backup Tests" +echo "==================================================================" + +echo "" +echo "7.1 - backup" +echo "=================================" +echo "Description:" +echo "run a backup." +echo "Command: ./${gameservername} backup" +requiredstatus="ONLINE" +fn_setstatus +echo "test de-activated until issue #1839 fixed" +#(command_backup.sh) +fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.0 - Development Tools Tests" +echo "==================================================================" + +echo "" +echo "8.1 - dev - detect glibc" +echo "=================================" +echo "Description:" +echo "detect glibc." +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.2 - dev - detect ldd" +echo "=================================" +echo "Description:" +echo "detect ldd." +echo "Command: ./${gameservername} detect-ldd" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.3 - dev - detect deps" +echo "=================================" +echo "Description:" +echo "detect dependencies." +echo "Command: ./${gameservername} detect-deps" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "Inserting IP address" +echo "=================================" +echo "Description:" +echo "Inserting Travis IP in to config." +echo "Allows monitor to work" +if [ "$(ip -o -4 addr|grep eth0)" ]; then + travisip=$(ip -o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0) +else + travisip=$(ip -o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) +fi +sed -i "/server-ip=/c\server-ip=${travisip}" "${serverfiles}/server.properties" +echo "IP: ${travisip}" + +echo "" +echo "8.4 - dev - query-raw" +echo "=================================" +echo "Description:" +echo "raw query output." +echo "Command: ./${gameservername} query-raw" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "=================================" +echo "Server Tests - Complete!" +echo "Using: ${gamename}" +echo "=================================" +requiredstatus="OFFLINE" +fn_setstatus +fn_print_info "Tidying up directories." +rm -rfv "${serverfiles}" +core_exit.sh diff --git a/tests/tests_shellcheck.sh b/tests/tests_shellcheck.sh new file mode 100644 index 000000000..6d33507e6 --- /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) 2019 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 "=================================" +echo "Travis CI Tests" +echo "Linux Game Server Manager" +echo "by Daniel Gibbs" +echo "Contributors: http://goo.gl/qLmitD" +echo "https://linuxgsm.com" +echo "=================================" +echo "" +echo "=================================" +echo "Bash Analysis Tests" +echo "Using: Shellcheck" +echo "Testing Branch: $TRAVIS_BRANCH" +echo "=================================" +echo "" +scissues=$(find . -type f \( -name "*.sh" -o -name "*.cfg" \) -not -path "./shunit2-2.1.6/*" -exec shellcheck --shell=bash --exclude=SC2154,SC2034 {} \; | grep -F "^--" | wc -l) +echo "Found issues: ${scissues}" +echo "=================================" +find . -type f \( -name "*.sh" -o -name "*.cfg" \) -not -path "./shunit2-2.1.6/*" -exec shellcheck --shell=bash --exclude=SC2154,SC2034 {} \; +echo "" +echo "=================================" +echo "Bash Analysis Tests - Complete!" +echo "Using: Shellcheck" +echo "=================================" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 82a4cc147..d243ef13e 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -1,140 +1,391 @@ #!/bin/bash -# TravisCI Tests: Teamspeak 3 -# Server Management Script +# Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# Website: https://gameservermanagers.com -version="101716" - +# License: MIT License, Copyright (c) 2019 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 -#### Variables #### +travistest="1" +version="v19.6.0" +shortname="ts3" +gameservername="ts3server" +rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +servicename="${gameservername}" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/lgsm" +steamcmddir="${rootdir}/steamcmd" +serverfiles="${rootdir}/serverfiles" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" +tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +serverlist="${datadir}/serverlist.csv" +serverlistmenu="${datadir}/serverlistmenu.csv" +configdir="${lgsmdir}/config-lgsm" +configdirserver="${configdir}/${gameservername}" +configdirdefault="${lgsmdir}/config-default" +userinput="${1}" + +# Allows for testing not on Travis CI +if [ ! -v TRAVIS ]; then + TRAVIS_BRANCH="develop" + TRAVIS_BUILD_DIR="${rootdir}" +fi -# Notification Alerts -# (on|off) +## 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}" -# Email -emailalert="off" -email="email@example.com" -#emailfrom="email@example.com" +# Core function that is required first. +core_functions.sh(){ + functionfile="${FUNCNAME}" + fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +} -# Pushbullet -# https://www.pushbullet.com/#settings -pushbulletalert="off" -pushbullettoken="accesstoken" +# Bootstrap +# Fetches the core functions required before passed off to core_dl.sh. + +# Fetches core functions. +fn_bootstrap_fetch_file(){ + remote_fileurl="${1}" + local_filedir="${2}" + local_filename="${3}" + chmodx="${4:-0}" + run="${5:-0}" + forcedl="${6:-0}" + md5="${7:-0}" + # Download file if missing or download forced. + if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + if [ ! -d "${local_filedir}" ]; then + mkdir -p "${local_filedir}" + fi + # Defines curl path. + curlpath=$(command -v curl 2>/dev/null) + + # If curl exists download file. + if [ "$(basename "${curlpath}")" == "curl" ]; then + # Trap to remove part downloaded files. + echo -en " fetching ${local_filename}...\c" + curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1) + local exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + if [ -f "${lgsmlog}" ]; then + echo -e "${remote_fileurl}" | tee -a "${lgsmlog}" + echo "${curlcmd}" | tee -a "${lgsmlog}" + fi + exit 1 + else + echo -e "OK" + fi + else + echo "[ FAIL ] Curl is not installed" + exit 1 + fi + # Make file chmodx if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" + fi + fi -# Start Variables -updateonstart="off" + if [ -f "${local_filedir}/${local_filename}" ]; then + # Run file if run is set. + if [ "${run}" == "run" ]; then + source "${local_filedir}/${local_filename}" + fi + fi +} -fn_parms(){ -parms="" +fn_bootstrap_fetch_file_github(){ + github_file_url_dir="${1}" + github_file_url_name="${2}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + + remote_fileurl="${githuburl}" + 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}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } -#### Advanced Variables #### +# Installer menu. -# 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" +fn_print_center() { + columns="$(tput cols)" + line="$@" + printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" +} -# Server Details -gamename="Teamspeak 3" -servername="Teamspeak 3 Server" -servicename="ts3-server" +fn_print_horizontal(){ + char="${1:-=}" + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "${char}" +} -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./ts3server_startscript.sh" -servercfg="${servicename}.ini" -servercfgdefault="ts3server.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 - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" +# 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 "${line}" | awk -F "," '{print $2 " - " $3}') + menu_options+=( "${var}" ) + done < ${options} + menu_options+=( "Cancel" ) + select option in "${menu_options[@]}"; do + if [ -n "${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 "${line}" | awk -F "," '{print $3}') + val=$(echo "${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 - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then +} + +# 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 [ -x "$(command -v "${menucmd}")" ]; then + menucmd=$(command -v "${menucmd}") break fi done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" + 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 "Usage: $0 [option]" + echo -e "" + echo "Installer - Linux Game Server Managers - Version ${version}" + echo "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 + let 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 "Installed ${gamename} server as ${local_filename}" + echo "" + if [ ! -d "${serverfiles}" ]; then + echo "./${local_filename} install" + else + echo "Remember to check server ports" + echo "./${local_filename} details" + fi + echo "" + 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 "[ FAIL ] Do NOT run this script as root!" exit 1 - else - echo -e "\e[0;32mOK\e[0m" fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" + elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + echo "[ FAIL ] Do NOT run this script as root!" exit 1 + else + core_functions.sh + check_root.sh fi - chmod +x "${filedir}/${filename}" fi -source "${filedir}/${filename}" -} -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} +# Download the latest serverlist. This is the complete list of all supported servers. +fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" +if [ ! -f "${serverlist}" ]; then + echo "[ FAIL ] serverlist.csv could not be loaded." + exit 1 +fi -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} +# LinuxGSM installer mode. +if [ "${shortname}" == "core" ]; then + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + { + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' + } | column -s $'\t' -t | more + exit + elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" + fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" + userinput="${result}" + fn_server_info + if [ "${result}" == "${gameservername}" ]; then + fn_install_file + elif [ "${result}" == "" ]; then + echo "Install canceled" + else + echo "[ FAIL ] menu result does not match gameservername" + echo "result: ${result}" + echo "gameservername: ${gameservername}" + fi + elif [ -n "${userinput}" ]; then + fn_server_info + if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + fn_install_file + else + echo "[ FAIL ] unknown game server" + fi + else + fn_install_getopt + fi -core_dl.sh -core_functions.sh +# LinuxGSM server mode. +else + core_functions.sh + if [ "${shortname}" != "core-dep" ]; then + # Load LinuxGSM configs. + # These are required to get all the default variables for the specific server. + # Load the default config. If missing download it. If changed reload it. + if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then + mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" + fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + fi + if [ ! -f "${configdirserver}/_default.cfg" ]; then + mkdir -p "${configdirserver}" + echo -en " copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + else + function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${function_file_diff}" != "" ]; then + fn_print_warn_nl "_default.cfg has been altered. reloading config." + echo -en " copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + fi + fi + source "${configdirserver}/_default.cfg" + # Load the common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/common.cfg" + else + source "${configdirserver}/common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/${servicename}.cfg" + else + source "${configdirserver}/${servicename}.cfg" + fi + + # Load the linuxgsm.sh in to tmpdir. If missing download it. + if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" + fi + 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 @@ -163,7 +414,7 @@ fn_setstatus(){ while [ "${requiredstatus}" != "${currentstatus}" ]; do counter=$((counter+1)) fn_currentstatus_ts3 - echo -ne "New status: ${currentstatus}\\r" + echo -en "New status: ${currentstatus}\\r" if [ "${requiredstatus}" == "ONLINE" ]; then (command_start.sh > /dev/null 2>&1) @@ -178,16 +429,15 @@ fn_setstatus(){ exit 1 fi done - echo -ne "New status: ${currentstatus}\\r" + echo -en "New status: ${currentstatus}\\r" echo -e "\n" echo "Test starting:" echo "" - sleep 0.5 } # 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 excpecting a pass +# if expecting a pass fn_test_result_pass(){ if [ $? != 0 ]; then echo "=================================" @@ -205,7 +455,7 @@ fn_test_result_pass(){ fi } -# if excpecting a fail +# if expecting a fail fn_test_result_fail(){ if [ $? == 0 ]; then echo "=================================" @@ -223,11 +473,20 @@ fn_test_result_fail(){ fi } +# test result n/a +fn_test_result_na(){ + echo "=================================" + echo "Expected result: N/A" + echo "Actual result: N/A" + fn_print_fail_nl "TEST N/A" +} + echo "=================================" -echo "TravisCI Tests" +echo "Travis CI Tests" echo "Linux Game Server Manager" echo "by Daniel Gibbs" -echo "https://gameservermanagers.com" +echo "Contributors: http://goo.gl/qLmitD" +echo "https://linuxgsm.com" echo "=================================" echo "" echo "=================================" @@ -235,211 +494,516 @@ echo "Server Tests" echo "Using: ${gamename}" echo "Testing Branch: $TRAVIS_BRANCH" echo "=================================" -echo "" -echo "0.1 - Create log dir's" -echo "=================================" +echo "" +echo "0.0 - Pre-test Tasks" +echo "==================================================================" echo "Description:" echo "Create log dir's" echo "" -(install_logs.sh) +echo "" +echo "0.1 - Create log dir's" +echo "=================================" +echo "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + install_logs.sh +) +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo "" echo "0.2 - Enable dev-debug" echo "=================================" echo "Description:" echo "Enable dev-debug" echo "" -(command_dev_debug.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_debug.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "1.0 - start - no files" +echo "" +echo "1.0 - Pre-install tests" +echo "==================================================================" +echo "" + +echo "1.1 - start - no files" echo "=================================" echo "Description:" echo "test script reaction to missing server files." -echo "Command: ./ts3server start" +echo "Command: ./${gameservername} start" echo "" -(command_start.sh) +# Allows for testing not on Travis CI +if [ ! -v TRAVIS ]; then +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) fn_test_result_fail +else + echo "Test bypassed" +fi + +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" -echo "1.1 - getopt" +echo "1.2 - getopt" echo "=================================" echo "Description:" echo "displaying options messages." -echo "Command: ./ts3server" +echo "Command: ./${gameservername}" echo "" -(core_getopt.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" -echo "1.2 - getopt with incorrect args" +echo "1.3 - getopt with incorrect args" echo "=================================" echo "Description:" echo "displaying options messages." -echo "Command: ./ts3server abc123" +echo "Command: ./${gameservername} abc123" echo "" getopt="abc123" -(core_getopt.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) fn_test_result_fail +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "2.0 - Installation" +echo "==================================================================" echo "" echo "2.0 - install" echo "=================================" echo "Description:" echo "install ${gamename} server." -echo "Command: ./ts3server auto-install" -(fn_autoinstall) +echo "Command: ./${gameservername} auto-install" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + fn_autoinstall +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo "" +echo "3.0 - Start/Stop/Restart Tests" +echo "==================================================================" echo "" echo "3.1 - start" echo "=================================" echo "Description:" echo "start ${gamename} server." -echo "Command: ./ts3server start" +echo "Command: ./${gameservername} start" requiredstatus="OFFLINE" fn_setstatus -(command_start.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "3.2 - start - online" echo "=================================" echo "Description:" echo "start ${gamename} server while already running." -echo "Command: ./ts3server start" +echo "Command: ./${gameservername} start" requiredstatus="ONLINE" fn_setstatus -(command_start.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) fn_test_result_fail +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "3.3 - start - updateonstart" echo "=================================" echo "Description:" echo "will update server on start." -echo "Command: ./ts3server start" +echo "Command: ./${gameservername} start" requiredstatus="OFFLINE" fn_setstatus -(updateonstart="on";command_start.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + updateonstart="on";command_start.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "3.4 - stop" echo "=================================" echo "Description:" echo "stop ${gamename} server." -echo "Command: ./ts3server stop" +echo "Command: ./${gameservername} stop" requiredstatus="ONLINE" fn_setstatus -(command_stop.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_stop.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "3.5 - stop - offline" echo "=================================" echo "Description:" echo "stop ${gamename} server while already stopped." -echo "Command: ./ts3server stop" +echo "Command: ./${gameservername} stop" requiredstatus="OFFLINE" fn_setstatus -(command_stop.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_stop.sh +) fn_test_result_fail +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "3.6 - restart" echo "=================================" echo "Description:" echo "restart ${gamename}." -echo "Command: ./ts3server restart" +echo "Command: ./${gameservername} restart" requiredstatus="ONLINE" fn_setstatus -(command_restart.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_restart.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "3.7 - restart - offline" echo "=================================" echo "Description:" echo "restart ${gamename} while already stopped." -echo "Command: ./ts3server restart" +echo "Command: ./${gameservername} restart" requiredstatus="OFFLINE" fn_setstatus -(command_restart.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_restart.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "4.0 - Update Tests" +echo "==================================================================" echo "" echo "4.1 - update" echo "=================================" echo "Description:" echo "check for updates." -echo "Command: ./jc2server update" +echo "Command: ./${gameservername} update" requiredstatus="OFFLINE" fn_setstatus -(command_update.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update.sh +) fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" -echo "4.2 - update-functions" -echo "=================================" -echo "Description:" -echo "runs update-functions." +echo "5.0 - Monitor Tests" +echo "==================================================================" echo "" -echo "Command: ./jc2server update-functions" -requiredstatus="OFFLINE" -fn_setstatus -(command_update_functions.sh) -fn_test_result_pass +echo "Server IP - Port: ${ip}:${port}" +echo "Server IP - Query Port: ${ip}:${queryport}" echo "" echo "5.1 - monitor - online" echo "=================================" echo "Description:" echo "run monitor server while already running." -echo "Command: ./ts3server monitor" +echo "Command: ./${gameservername} monitor" requiredstatus="ONLINE" fn_setstatus -(command_monitor.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) fn_test_result_pass - +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "5.2 - monitor - offline - with lockfile" echo "=================================" echo "Description:" echo "run monitor while server is offline with lockfile." -echo "Command: ./ts3server monitor" +echo "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." -date > "${rootdir}/${lockselfname}" -(command_monitor.sh) +date '+%s' > "${rootdir}/${lockselfname}" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) fn_test_result_pass - +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "5.3 - monitor - offline - no lockfile" echo "=================================" echo "Description:" echo "run monitor while server is offline with no lockfile." -echo "Command: ./ts3server monitor" +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "5.4 - test-alert" +echo "=================================" +echo "Description:" +echo "run monitor while server is offline with no lockfile." +echo "Command: ./${gameservername} test-alert" requiredstatus="OFFLINE" fn_setstatus -(command_monitor.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_test_alert.sh +) fn_test_result_fail +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" -echo "6.0 - details" +echo "6.0 - Details Tests" +echo "==================================================================" + +echo "" +echo "6.1 - details" echo "=================================" echo "Description:" echo "display details." -echo "Command: ./ts3server details" +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "6.2 - postdetails" +echo "=================================" +echo "Description:" +echo "post details." +echo "Command: ./${gameservername} postdetails" requiredstatus="ONLINE" fn_setstatus -(command_details.sh) +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_postdetails.sh +) +fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "7.0 - Backup Tests" +echo "==================================================================" + +echo "" +echo "7.1 - backup" +echo "=================================" +echo "Description:" +echo "run a backup." +echo "Command: ./${gameservername} backup" +requiredstatus="ONLINE" +fn_setstatus +echo "test de-activated until issue #1839 fixed" +#(command_backup.sh) +fn_test_result_pass +echo "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.0 - Development Tools Tests" +echo "==================================================================" + +echo "" +echo "8.1 - dev - detect glibc" +echo "=================================" +echo "Description:" +echo "detect glibc." +echo "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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.2 - dev - detect ldd" +echo "=================================" +echo "Description:" +echo "detect ldd." +echo "Command: ./${gameservername} detect-ldd" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.3 - dev - detect deps" +echo "=================================" +echo "Description:" +echo "detect dependencies." +echo "Command: ./${gameservername} detect-deps" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo "" +echo "8.4 - dev - query-raw" +echo "=================================" +echo "Description:" +echo "raw query output." +echo "Command: ./${gameservername} query-raw" +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 "run order" +echo "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo "" echo "=================================" @@ -448,8 +1012,6 @@ echo "Using: ${gamename}" echo "=================================" requiredstatus="OFFLINE" fn_setstatus -sleep 1 fn_print_info "Tidying up directories." -sleep 1 rm -rfv "${serverfiles}" core_exit.sh