diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..506b50754 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,30 @@ +{ + "name": "BASH Dev Container", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ghcr.io/devcontainers-community/npm-features/prettier:1": { + "plugins": "prettier-plugin-sh" + }, + "ghcr.io/devcontainers-extra/features/actionlint:1": {}, + "ghcr.io/devcontainers-extra/features/checkov:1": {}, + "ghcr.io/devcontainers-extra/features/markdownlint-cli:1": {}, + "ghcr.io/devcontainers-extra/features/shellcheck:1": {}, + "ghcr.io/devcontainers-extra/features/yamllint:2": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "DavidAnson.vscode-markdownlint", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "github.vscode-github-actions", + "GitHub.vscode-pull-request-github", + "redhat.vscode-yaml", + "timonwong.shellcheck", + "yzhang.markdown-all-in-one" + ] + } + }, + "postCreateCommand": "npm init -y >/dev/null 2>&1 || true && npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template" +} diff --git a/.editorconfig b/.editorconfig index f20e02e1c..f816affbe 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,28 +1,32 @@ # 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 - -# YAML Files -[*.{yml,yaml}] indent_size = 2 indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true -# JSON Files -[*.{json,json5,webmanifest}] +# BASH Files +[*.sh] +indent_size = 4 +indent_style = tab + +# JSON Files (Biome formatting) +[*.json] +indent_style = tab indent_size = 2 -indent_style = space -# BASH Files -[*.{.sh}] +# Steam appmanifest files (Valve ACF format) +[*.acf] indent_style = tab indent_size = 4 + +# Python +[*.py] +indent_style = space +indent_size = 4 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 441867e9c..dc3c5b515 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,12 +1,2 @@ -# These are supported funding model platforms - -github: dgibbs64 # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: dgibbs # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with a single custom sponsorship URL +github: dgibbs64 +patreon: dgibbs diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 443cf3bec..84c7ea0ee 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,8 +1,11 @@ -# Set update schedule for GitHub Actions version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: - # Check for updates to GitHub Actions every weekday - interval: "daily" + interval: "weekly" + + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/.github/linters/.codespellrc b/.github/linters/.codespellrc new file mode 100644 index 000000000..47dd5ccea --- /dev/null +++ b/.github/linters/.codespellrc @@ -0,0 +1,11 @@ +[codespell] +# Skip data tables that contain many short server identifiers (e.g. "fof", "nd") +skip = + lgsm/data/*.csv, + package-lock.json, + */package-lock.json, + node_modules, + */node_modules/* + +# Ignore common identifiers/acronyms and extensions used throughout LinuxGSM +ignore-words-list = distroname,fof,nd,sav,parms,ThirdParty diff --git a/.github/linters/.flake8 b/.github/linters/.flake8 new file mode 100644 index 000000000..6deafc261 --- /dev/null +++ b/.github/linters/.flake8 @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 120 diff --git a/.github/linters/.gitleaks.toml b/.github/linters/.gitleaks.toml new file mode 100644 index 000000000..b61845ba6 --- /dev/null +++ b/.github/linters/.gitleaks.toml @@ -0,0 +1,9 @@ +title = "LinuxGSM Gitleaks Config" + +[allowlist] + description = "Known false positives" + regexes = [ + # Google Analytics 4 Measurement Protocol API secret - not a sensitive credential, + # it is intentionally embedded in client-side code and is safe to be public. + '''apisecret="[A-Za-z0-9_\-]+"''', + ] diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 000000000..62d421814 --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,20 @@ +# Configuration for markdownlint (used by Super Linter) + +# MD041: README starts with HTML badges in this repo. +MD041: false + +# MD051: GitHub heading anchor generation can differ (emoji, punctuation). +MD051: false + +# MD013: The project documentation frequently contains long URLs/commands. +MD013: false + +# MD033: The main README uses inline HTML for badges. +MD033: false + +# MD007: Repo uses 2-space indentation for nested lists. +MD007: + indent: 2 + +# MD030: Repo mixes 1-space unordered and 2-space ordered list markers. +MD030: false diff --git a/.github/linters/.shellcheckrc b/.github/linters/.shellcheckrc new file mode 100644 index 000000000..d16f69e0b --- /dev/null +++ b/.github/linters/.shellcheckrc @@ -0,0 +1 @@ +disable=SC2154,SC2034 diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml new file mode 100644 index 000000000..c42932a49 --- /dev/null +++ b/.github/linters/.yaml-lint.yml @@ -0,0 +1,25 @@ +extends: default + +rules: + document-start: disable + truthy: disable + + line-length: + max: 200 + level: warning + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true + + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + min-spaces-inside-empty: 0 + max-spaces-inside-empty: 0 + + empty-lines: + max: 2 + max-start: 0 + max-end: 0 + + comments: + min-spaces-from-content: 1 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4e6d08327..9f6864e57 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,30 +6,30 @@ Fixes #[issue] ## Type of change -- [ ] Bug fix (a change which fixes an issue). -- [ ] New feature (a change which adds functionality). -- [ ] New Server (new server added). -- [ ] Refactor (restructures existing code). -- [ ] Comment update (typo, spelling, explanation, examples, etc). +- [ ] Bug fix (a change which fixes an issue). +- [ ] New feature (a change which adds functionality). +- [ ] New Server (new server added). +- [ ] Refactor (restructures existing code). +- [ ] Comment update (typo, spelling, explanation, examples, etc). ## Checklist PR will not be merged until all steps are complete. -- [ ] This pull request links to an issue. -- [ ] This pull request uses the `develop` branch as its base. -- [ ] This pull request subject follows the Conventional Commits standard. -- [ ] This code follows the style guidelines of this project. -- [ ] I have performed a self-review of my code. -- [ ] I have checked that this code is commented where required. -- [ ] I have provided a detailed enough description of this PR. -- [ ] I have checked if documentation needs updating. +- [ ] This pull request links to an issue. +- [ ] This pull request uses the `develop` branch as its base. +- [ ] This pull request subject follows the Conventional Commits standard. +- [ ] This code follows the style guidelines of this project. +- [ ] I have performed a self-review of my code. +- [ ] I have checked that this code is commented where required. +- [ ] I have provided a detailed enough description of this PR. +- [ ] I have checked if documentation needs updating. ## Documentation If documentation does need updating either update it by creating a PR (preferred) or request a documentation update. -- User docs: https://github.com/GameServerManagers/LinuxGSM-Docs -- Dev docs: https://github.com/GameServerManagers/LinuxGSM-Dev-Docs +- User docs: +- Dev docs: **Thank you for your Pull Request!** diff --git a/.github/workflows/action-prettier.yml b/.github/workflows/action-prettier.yml new file mode 100644 index 000000000..f5d51a44a --- /dev/null +++ b/.github/workflows/action-prettier.yml @@ -0,0 +1,36 @@ +name: Prettier + +on: + workflow_dispatch: + push: + branches: + - "*" + +concurrency: + group: prettier-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: write + +jobs: + prettier: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + + - name: Install Prettier and plugins + run: | + npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template + + - name: Prettify code + uses: creyD/prettier_action@v4.6 + with: + prettier_plugins: "prettier-plugin-sh prettier-plugin-jinja-template" + prettier_options: --write . + github_token: ${{ secrets.GITHUB_TOKEN }} + commit_message: "chore(prettier): format code" diff --git a/.github/workflows/action-super-linter.yml b/.github/workflows/action-super-linter.yml new file mode 100644 index 000000000..31b2fa949 --- /dev/null +++ b/.github/workflows/action-super-linter.yml @@ -0,0 +1,53 @@ +name: Super Linter + +on: + workflow_dispatch: + push: + branches: + - "*" + +concurrency: + group: super-linter-${{ github.ref }} + cancel-in-progress: true + +permissions: {} + +jobs: + build: + name: Lint + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 + persist-credentials: false + + - name: Install Prettier plugins (for summary formatting) + run: | + npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template || true + + - name: Super-linter + uses: super-linter/super-linter@v8 + env: + # To report GitHub Actions status checks + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_BIOME_FORMAT: false + VALIDATE_BIOME_LINT: false + VALIDATE_GITHUB_ACTIONS_ZIZMOR: false + VALIDATE_JSCPD: false + VALIDATE_JSON_PRETTIER: false + VALIDATE_MARKDOWN_PRETTIER: false + VALIDATE_NATURAL_LANGUAGE: false + VALIDATE_SHELL_SHFMT: false + VALIDATE_TRIVY: false + VALIDATE_YAML_PRETTIER: false diff --git a/.github/workflows/action-update-copyright-years-in-license-file.yml b/.github/workflows/action-update-copyright-years-in-license-file.yml new file mode 100644 index 000000000..ab1549f0e --- /dev/null +++ b/.github/workflows/action-update-copyright-years-in-license-file.yml @@ -0,0 +1,29 @@ +name: Update copyright year(s) in license file + +on: + workflow_dispatch: + schedule: + - cron: "0 3 1 1 *" # 03:00 AM on January 1 + +permissions: + contents: write + +jobs: + update-license-year: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + persist-credentials: false + - name: Action Update License Year + uses: FantasticFiasco/action-update-license-year@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + path: LICENSE.md + - name: Merge pull request + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr merge --merge --delete-branch diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml index e0b06990f..e96336264 100644 --- a/.github/workflows/add-to-project.yml +++ b/.github/workflows/add-to-project.yml @@ -5,6 +5,8 @@ on: - opened - labeled +permissions: {} + jobs: add-to-project: if: github.repository_owner == 'GameServerManagers' diff --git a/.github/workflows/details-check-generate-matrix.sh b/.github/workflows/details-check-generate-matrix.sh index bba9e8d5d..1093a46cf 100755 --- a/.github/workflows/details-check-generate-matrix.sh +++ b/.github/workflows/details-check-generate-matrix.sh @@ -1,6 +1,7 @@ #!/bin/bash -curl "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/lgsm/data/serverlist.csv" | grep -v '^[[:blank:]]*$' > serverlist.csv +ref="${LGSM_REF:-${GITHUB_REF#refs/heads/}}" +curl "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${ref}/lgsm/data/serverlist.csv" | grep -v '^[[:blank:]]*$' > serverlist.csv echo -n "{" > "shortnamearray.json" echo -n "\"include\":[" >> "shortnamearray.json" @@ -14,10 +15,28 @@ while read -r line; do export gamename distro=$(echo "$line" | awk -F, '{ print $4 }') export distro - echo -n "{" >> "shortnamearray.json" - echo -n "\"shortname\":" >> "shortnamearray.json" - echo -n "\"${shortname}\"" >> "shortnamearray.json" - echo -n "}," >> "shortnamearray.json" + # Legacy servers that require older Ubuntu/Debian versions due to glibc compatibility + case "${shortname}" in + bfv|bf1942) + # Requires Ubuntu <= 22.04 or Debian <= 12 (glibc 2.31 compatible) + runner="ubuntu-22.04" + ;; + btl|onset) + # Requires Ubuntu <= 20.04 or Debian <= 11 (glibc 2.31 compatible) + runner="ubuntu-20.04" + ;; + *) + runner="ubuntu-latest" + ;; + esac + { + echo -n "{"; + echo -n "\"shortname\":"; + echo -n "\"${shortname}\""; + echo -n ",\"runner\":"; + echo -n "\"${runner}\""; + echo -n "},"; + } >> "shortnamearray.json" done < <(tail -n +2 serverlist.csv) sed -i '$ s/.$//' "shortnamearray.json" echo -n "]" >> "shortnamearray.json" diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index 748a77991..856ab2d2a 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -6,6 +6,9 @@ on: branches: - develop +permissions: + contents: read + concurrency: group: details-check-${{ github.ref_name }} cancel-in-progress: true @@ -14,11 +17,13 @@ jobs: create-matrix: if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest + env: + LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }} outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Generate matrix with generate-matrix.sh run: chmod +x .github/workflows/details-check-generate-matrix.sh; .github/workflows/details-check-generate-matrix.sh @@ -28,20 +33,22 @@ jobs: run: | shortnamearray=$(cat shortnamearray.json) echo "${shortnamearray}" - echo -n "matrix=${shortnamearray}" >> $GITHUB_OUTPUT + echo -n "matrix=${shortnamearray}" >> "$GITHUB_OUTPUT" details-check: if: github.repository_owner == 'GameServerManagers' needs: create-matrix continue-on-error: true - runs-on: ubuntu-latest + runs-on: ${{ matrix.runner }} + env: + LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }} strategy: matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }} steps: - name: Download linuxgsm.sh - run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh + run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${LGSM_REF}/linuxgsm.sh"; chmod +x linuxgsm.sh - name: Install dependencies run: sudo apt-get install libxml2-utils jq @@ -50,10 +57,10 @@ jobs: run: mkdir -p serverfiles - name: Grab server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./linuxgsm.sh ${{ matrix.shortname }}server - name: Enable developer mode - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server developer - name: Generate servercfgname id: sets-servercfgname @@ -68,6 +75,10 @@ jobs: else curl -f -o config "https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main/${{ matrix.shortname }}/${{ steps.sets-servercfgname.outputs.servercfgname }}" fi + + - name: Pre-load LinuxGSM + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server details + - name: Display config run: | if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then @@ -80,10 +91,10 @@ jobs: run: grep "startparameters" lgsm/config-default/config-lgsm/${{ matrix.shortname }}server/_default.cfg - name: Details - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server details + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server details - name: Detect details - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server parse-game-details + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server parse-game-details - name: Query Raw - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server query-raw + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server query-raw diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml index 544ba6892..986346c49 100644 --- a/.github/workflows/git-sync.yml +++ b/.github/workflows/git-sync.yml @@ -7,13 +7,15 @@ on: - master - develop +permissions: {} + jobs: gitHub-to-bitbucket: if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - name: SSH Agent - uses: webfactory/ssh-agent@v0.9.0 + uses: webfactory/ssh-agent@v0.10.0 with: ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index ce00b840b..a0a810172 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -1,11 +1,13 @@ name: Lock Threads on: + workflow_dispatch: schedule: - cron: "0 0 * * 1" permissions: issues: write pull-requests: write + discussions: write jobs: lock: @@ -13,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Lock Threads - uses: dessant/lock-threads@v5 + uses: dessant/lock-threads@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }} issue-comment: > diff --git a/.github/workflows/potential-duplicates.yml b/.github/workflows/potential-duplicates.yml index ea0ba23fd..39a3189d8 100644 --- a/.github/workflows/potential-duplicates.yml +++ b/.github/workflows/potential-duplicates.yml @@ -3,6 +3,10 @@ on: issues: types: - opened + +permissions: + issues: write + jobs: potential-duplicates: if: github.repository_owner == 'GameServerManagers' diff --git a/.github/workflows/serverlist-validate-game-icons.sh b/.github/workflows/serverlist-validate-game-icons.sh index 2fdb0ff8f..8d35aa906 100755 --- a/.github/workflows/serverlist-validate-game-icons.sh +++ b/.github/workflows/serverlist-validate-game-icons.sh @@ -2,6 +2,8 @@ cd "${datadir}" || exit +exitcode=0 + echo "" echo "Checking that all the game servers listed in serverlist.csv have a shortname-icon.png file" for shortname in $(tail -n +2 serverlist.csv | cut -d ',' -f1); do @@ -16,9 +18,11 @@ done echo "" echo "Checking if an unexpected gameicon exists" -for gameicon in $(ls -1 gameicons); do +shopt -s nullglob +for gameiconpath in gameicons/*; do + gameicon="$(basename "${gameiconpath}")" # check if $gameicon is in serverlist.csv - if ! grep -q "${gameicon%-icon.png}" serverlist.csv; then + if ! grep -q -E "^${gameicon%-icon.png}," serverlist.csv; then echo "ERROR: gameicon ${gameicon} is not in serverlist.csv" exitcode=1 else @@ -28,7 +32,7 @@ done echo "" echo "Checking that the number of gameicons matches the number of servers in serverlist.csv" -gameiconcount="$(ls -1 gameicons | wc -l)" +gameiconcount="$(find gameicons -mindepth 1 -maxdepth 1 -type f | wc -l)" serverlistcount="$(tail -n +2 serverlist.csv | wc -l)" if [ "${gameiconcount}" -ne "${serverlistcount}" ]; then echo "ERROR: game icons (${gameiconcount}) does not match serverlist.csv ($serverlistcount)" @@ -37,4 +41,4 @@ else echo "OK: gameiconcount ($gameiconcount) matches serverlistcount ($serverlistcount)" fi -exit ${exitcode} +exit "${exitcode}" diff --git a/.github/workflows/serverlist-validate.sh b/.github/workflows/serverlist-validate.sh index 7d931372d..3d83d89da 100755 --- a/.github/workflows/serverlist-validate.sh +++ b/.github/workflows/serverlist-validate.sh @@ -3,12 +3,15 @@ echo "Checking that all the game servers are listed in all csv files" echo "this check will ensure serverlist.csv has the same number of lines (-2 lines) as the other csv files" # count the number of lines in the serverlist.csv cd "${datadir}" || exit + +exitcode=0 serverlistcount="$(tail -n +2 serverlist.csv | wc -l)" echo "serverlistcount: $serverlistcount" # get list of all csv files starting with ubunutu debian centos -csvlist="$(ls -1 | grep -E '^(ubuntu|debian|centos|rhel|almalinux|rocky).*\.csv$')" +shopt -s nullglob +csvlist=(ubuntu*.csv debian*.csv centos*.csv rhel*.csv almalinux*.csv rocky*.csv) # loop though each csv file and make sure the number of lines is the same as the serverlistcount -for csv in $csvlist; do +for csv in "${csvlist[@]}"; do csvcount="$(wc -l < "${csv}")" csvcount=$((csvcount - 2)) if [ "$csvcount" -ne "$serverlistcount" ]; then @@ -35,4 +38,4 @@ for shortname in $(tail -n +2 serverlist.csv | cut -d ',' -f1); do fi done -exit ${exitcode} +exit "${exitcode}" diff --git a/.github/workflows/serverlist-validate.yml b/.github/workflows/serverlist-validate.yml index f4a95a039..e2016eddf 100644 --- a/.github/workflows/serverlist-validate.yml +++ b/.github/workflows/serverlist-validate.yml @@ -3,13 +3,19 @@ on: workflow_dispatch: push: +permissions: + contents: read + +env: + datadir: lgsm/data + jobs: serverlist-validate: if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Compare Versions run: chmod +x .github/workflows/serverlist-validate.sh; .github/workflows/serverlist-validate.sh diff --git a/.github/workflows/trigger-docker-build.yml b/.github/workflows/trigger-docker-build.yml index ae66542de..823592457 100644 --- a/.github/workflows/trigger-docker-build.yml +++ b/.github/workflows/trigger-docker-build.yml @@ -1,9 +1,13 @@ name: Trigger Docker Build + on: + workflow_dispatch: release: types: - published +permissions: {} + jobs: trigger_build_docker-linuxgsm: if: github.repository_owner == 'GameServerManagers' @@ -11,12 +15,22 @@ jobs: runs-on: ubuntu-latest steps: - name: Trigger Workflow and Wait (linuxgsm) - uses: convictional/trigger-workflow-and-wait@v1.6.5 - with: - owner: GameServerManagers - repo: docker-linuxgsm - github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - workflow_file_name: docker-publish.yml + env: + GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + run: | + before=$(date -u +%Y-%m-%dT%H:%M:%SZ) + gh workflow run action-docker-publish.yml --repo GameServerManagers/docker-linuxgsm + sleep 10 + run_id=$(gh run list \ + --workflow action-docker-publish.yml \ + --repo GameServerManagers/docker-linuxgsm \ + --created ">=${before}" \ + --limit 1 \ + --json databaseId \ + --jq '.[0].databaseId') + gh run watch "${run_id}" \ + --repo GameServerManagers/docker-linuxgsm \ + --exit-status trigger_build_docker-gameserver: if: github.repository_owner == 'GameServerManagers' @@ -25,9 +39,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Trigger Workflow and Wait (gameserver) - uses: convictional/trigger-workflow-and-wait@v1.6.5 - with: - owner: GameServerManagers - repo: docker-gameserver - github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - workflow_file_name: docker-publish.yml + env: + GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + run: | + before=$(date -u +%Y-%m-%dT%H:%M:%SZ) + gh workflow run action-docker-publish.yml --repo GameServerManagers/docker-gameserver + sleep 10 + run_id=$(gh run list \ + --workflow action-docker-publish.yml \ + --repo GameServerManagers/docker-gameserver \ + --created ">=${before}" \ + --limit 1 \ + --json databaseId \ + --jq '.[0].databaseId') + gh run watch "${run_id}" \ + --repo GameServerManagers/docker-gameserver \ + --exit-status diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 932e3ea2a..ad1150f7b 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -6,6 +6,8 @@ on: branches: - develop +permissions: {} + concurrency: group: update-check-${{ github.ref_name }} cancel-in-progress: true @@ -13,39 +15,41 @@ concurrency: jobs: update-check: if: github.repository_owner == 'GameServerManagers' - continue-on-error: true runs-on: ubuntu-latest + env: + LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }} strategy: + fail-fast: false matrix: - shortname: [css, fctr, jk2, mc, mcb, mta, pmc, ts3, ut99, vints] + shortname: [css, fctr, jk2, mc, mcb, mta, pmc, ts3, ut99, vints, xnt] steps: - name: Download linuxgsm.sh - run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh + run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${LGSM_REF}/linuxgsm.sh"; chmod +x linuxgsm.sh - name: Install dependencies run: sudo dpkg --add-architecture i386; sudo apt-get update; - name: Grab server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./linuxgsm.sh ${{ matrix.shortname }}server - name: Enable developer mode - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server developer - name: Insert steamuser if: matrix.shortname == 'jk2' run: echo -e "steamuser=\"${{ secrets.STEAMCMD_USER }}\"\nsteampass='${{ secrets.STEAMCMD_PASS }}'" > lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg - name: Install server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server auto-install - name: Check Update server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server check-update + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server check-update - name: Update server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server update + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server update - name: Force Update server if: matrix.shortname == 'css' - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server force-update + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server force-update diff --git a/.github/workflows/update-copyright-years-in-license-file.yml b/.github/workflows/update-copyright-years-in-license-file.yml index 3301c9cb7..d9870a166 100644 --- a/.github/workflows/update-copyright-years-in-license-file.yml +++ b/.github/workflows/update-copyright-years-in-license-file.yml @@ -4,13 +4,17 @@ on: schedule: - cron: "0 3 1 1 *" # 03:00 AM on January 1 +permissions: + contents: write + pull-requests: write + jobs: update-license-year: if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Action Update License Year diff --git a/.github/workflows/version-check.sh b/.github/workflows/version-check.sh old mode 100644 new mode 100755 diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index cfa7615bd..2b4448643 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Version Check run: chmod +x .github/workflows/version-check.sh; .github/workflows/version-check.sh diff --git a/.gitignore b/.gitignore index e5c465ce2..c6dd34d73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,11 @@ -.vscode/settings.json -/node_modules +# Visual Studio Code +.vscode/* +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets +.history/ +*.vsix + +# Node.js +node_modules diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..7b065e422 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +# Prettier auto-commit runs with GITHUB_TOKEN (GitHub App). +# GitHub blocks that token from creating/updating anything under .github/workflows. +.github/workflows/** diff --git a/.prettierrc b/.prettierrc index 1902f8021..02d542d50 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,3 +1,3 @@ { - "plugins": ["prettier-plugin-sh"] + "plugins": ["prettier-plugin-sh"] } diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 000000000..02d542d50 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "plugins": ["prettier-plugin-sh"] +} diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 000000000..d16f69e0b --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1 @@ +disable=SC2154,SC2034 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c7a7dab10..d31b65dd2 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,10 +1,12 @@ { "recommendations": [ - "ms-python.python", + "DavidAnson.vscode-markdownlint", "editorconfig.editorconfig", - "yzhang.markdown-all-in-one", "esbenp.prettier-vscode", + "github.vscode-github-actions", + "GitHub.vscode-pull-request-github", + "redhat.vscode-yaml", "timonwong.shellcheck", - "redhat.vscode-yaml" + "yzhang.markdown-all-in-one" ] } diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index a69325281..fb935a066 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -17,24 +17,24 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -- Demonstrating empathy and kindness toward other people -- Being respectful of differing opinions, viewpoints, and experiences -- Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -- Focusing on what is best not just for us as individuals, but for the - overall community +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +- Focusing on what is best not just for us as individuals, but for the + overall community Examples of unacceptable behavior include: -- The use of sexualized language or imagery, and sexual attention or - advances of any kind -- Trolling, insulting or derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or email - address, without their explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting +- The use of sexualized language or imagery, and sexual attention or + advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email + address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting ## Enforcement Responsibilities diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b549c795..ab17437f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,31 +8,31 @@ The following is a set of guidelines for contributing to LinuxGSM, which are hos [Contributing to LinuxGSM](#contributing-to-linuxgsm) -- [Table of Contents](#table-of-contents) -- [Code of Conduct](#code-of-conduct) -- [🎉 Bug/Enhancement Contributions 🐛](#bug-enhancement-contributions) - - [🐛Reporting Bugs](#reporting-bugs) - - [Before Submitting A Bug Report](#before-submitting-a-bug-report) - - [How Do I Submit A (Good) Bug Report?](#how-do-i-submit-a--good--bug-report-) - - [🎉Suggesting Features](#suggesting-features) - - [Before Submitting An Feature Suggestion](#before-submitting-an-feature-suggestion) - - [How Do I Submit A (Good) Feature Suggestion?](#how-do-i-submit-a--good--feature-suggestion-) - - [🎮 Game Server Requests](#game-server-requests) - - [Before Submitting a Game Server Request](#before-submitting-a-game-server-request) - - [How Do I Submit A (Good) Game Server Request?](#how-do-i-submit-a--good--game-server-request-) - - [🎮 Game Server Specific Issues](#game-server-specific-issues) -- [💻 Code Contributions](#code-contributions) - - [Pull Requests](#pull-requests) - - [Pull Request naming convention](#pull-request-naming-convention) - - [Testing](#testing) - - [Pull Request Status Checks](#pull-request-status-checks) - - [Test Environment](#test-environment) - - [:wine_glass: Styleguides](#-wine-glass--styleguides) - - [Git Commit Messages](#git-commit-messages) - - [BASH Styleguide](#bash-styleguide) -- [:blue_book: Document Contributions](#-blue-book--document-contributions) - - [Documentation Styleguide](#documentation-styleguide) -- [Issue and Pull Request Labels](#issue-and-pull-request-labels) +- [Table of Contents](#table-of-contents) +- [Code of Conduct](#code-of-conduct) +- [🎉 Bug/Enhancement Contributions 🐛](#bug-enhancement-contributions) + - [🐛Reporting Bugs](#reporting-bugs) + - [Before Submitting A Bug Report](#before-submitting-a-bug-report) + - [How Do I Submit A (Good) Bug Report?](#how-do-i-submit-a--good--bug-report-) + - [🎉Suggesting Features](#suggesting-features) + - [Before Submitting An Feature Suggestion](#before-submitting-an-feature-suggestion) + - [How Do I Submit A (Good) Feature Suggestion?](#how-do-i-submit-a--good--feature-suggestion-) + - [🎮 Game Server Requests](#game-server-requests) + - [Before Submitting a Game Server Request](#before-submitting-a-game-server-request) + - [How Do I Submit A (Good) Game Server Request?](#how-do-i-submit-a--good--game-server-request-) + - [🎮 Game Server Specific Issues](#game-server-specific-issues) +- [💻 Code Contributions](#code-contributions) + - [Pull Requests](#pull-requests) + - [Pull Request naming convention](#pull-request-naming-convention) + - [Testing](#testing) + - [Pull Request Status Checks](#pull-request-status-checks) + - [Test Environment](#test-environment) + - [:wine_glass: Styleguides](#-wine-glass--styleguides) + - [Git Commit Messages](#git-commit-messages) + - [BASH Styleguide](#bash-styleguide) +- [:blue_book: Document Contributions](#-blue-book--document-contributions) + - [Documentation Styleguide](#documentation-styleguide) +- [Issue and Pull Request Labels](#issue-and-pull-request-labels) ## Code of Conduct @@ -48,20 +48,20 @@ Before creating bug reports, please check [this list](https://github.com/GameSer #### Before Submitting A Bug Report -- **Check the [documentation](https://docs.linuxgsm.com).** You might be able to find the cause of the problem and fix things yourself. -- **Check the** [**support page**](https://linuxgsm.com/support) for links to other support options. -- **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. +- **Check the [documentation](https://docs.linuxgsm.com).** You might be able to find the cause of the problem and fix things yourself. +- **Check the** [**support page**](https://linuxgsm.com/support) for links to other support options. +- **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. #### How Do I Submit A (Good) Bug Report? Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information by filling in [the issues form](https://github.com/GameServerManagers/LinuxGSM/issues/new/choose). -- **Use a clear and descriptive title** for the issue to identify the problem. -- **Complete the user story** to give a summary of the issue. -- **Provide basic info** to help us understand the context of the issue. -- **Provide further info** to give specifics and more detail. -- **Give steps to reproduce** the issue, allowing developers to follow steps that lead to the issue. -- **Explain what you expect** to happen, so we know what you think should occur. +- **Use a clear and descriptive title** for the issue to identify the problem. +- **Complete the user story** to give a summary of the issue. +- **Provide basic info** to help us understand the context of the issue. +- **Provide further info** to give specifics and more detail. +- **Give steps to reproduce** the issue, allowing developers to follow steps that lead to the issue. +- **Explain what you expect** to happen, so we know what you think should occur. ### 🎉Suggesting Features @@ -69,19 +69,19 @@ This section guides you through submitting a feature suggestion for LinuxGSM, in #### Before Submitting An Feature Suggestion -- **Check the** [**documentation**]() to confirm that the enhancement doesn’t already exist. -- **Check your** [**LinuxGSM version**](https://docs.linuxgsm.com/commands/update-lgsm)**.** A newer version of LinuxGSM may already have your enhancement. -- **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the enhancement has already been suggested. If it has **and the enhancement is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. +- **Check the** [**documentation**]() to confirm that the enhancement doesn’t already exist. +- **Check your** [**LinuxGSM version**](https://docs.linuxgsm.com/commands/update-lgsm)**.** A newer version of LinuxGSM may already have your enhancement. +- **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the enhancement has already been suggested. If it has **and the enhancement is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. #### How Do I Submit A (Good) Feature Suggestion? Features are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information by filling in [the issues form](https://github.com/GameServerManagers/LinuxGSM/issues/new/choose). -- **Use a clear and descriptive title** for the issue to identify the problem. -- **Complete the user story** to give a summary of the issue. -- **Provide basic info** to help us understand the context of the enhancement. -- **Provide further info** to give specifics and more detail. -- **Provide any further reading** materials that might assist in developing the enhancement. +- **Use a clear and descriptive title** for the issue to identify the problem. +- **Complete the user story** to give a summary of the issue. +- **Provide basic info** to help us understand the context of the enhancement. +- **Provide further info** to give specifics and more detail. +- **Provide any further reading** materials that might assist in developing the enhancement. ### 🎮 Game Server Requests @@ -89,14 +89,14 @@ This section guides you through submitting a game server request for LinuxGSM, F #### Before Submitting a Game Server Request -- **Check for existing** [**game server requests**](https://github.com/GameServerManagers/LinuxGSM/labels/type%3A%20game%20server%20request) to see if the new game server has already been suggested. If it has **and if the new game server is still open**, give it a thumbs up. -- **Check the game server is supported on Linux**, this does not include Wine servers which we do not support. +- **Check for existing** [**game server requests**](https://github.com/GameServerManagers/LinuxGSM/labels/type%3A%20game%20server%20request) to see if the new game server has already been suggested. If it has **and if the new game server is still open**, give it a thumbs up. +- **Check the game server is supported on Linux**, this does not include Wine servers which we do not support. #### How Do I Submit A (Good) Game Server Request? -- The title should be as follows: **[Server Request] Game Name** -- **Provide Steam App ID** if applicable -- **Supply any documentation/how-to guides** for the game server. +- The title should be as follows: **[Server Request] Game Name** +- **Provide Steam App ID** if applicable +- **Supply any documentation/how-to guides** for the game server. ### 🎮 Game Server Specific Issues @@ -114,10 +114,10 @@ A [list](https://docs.linuxgsm.com/support/game-server) of known game developer The process described here has several goals: -- Maintain LinuxGSM quality. -- Fix problems that are important to users. -- Engage the community in working toward the best possible LinuxGSM. -- Enable a sustainable system for LinuxGSM maintainers to review contributions. +- Maintain LinuxGSM quality. +- Fix problems that are important to users. +- Engage the community in working toward the best possible LinuxGSM. +- Enable a sustainable system for LinuxGSM maintainers to review contributions. Please follow these steps to have your contribution considered by the maintainers: @@ -139,24 +139,23 @@ If applied, this commit will _your subject line here_ For example: -- If applied, this commit will **refactor subsystem X for readability** -- If applied, this commit will **update getting started documentation** -- If applied, this commit will **remove deprecated methods** -- If applied, this commit will **release version 1.0.0** -- If applied, this commit will **merge pull request #123 from user/branch** +- If applied, this commit will **refactor subsystem X for readability** +- If applied, this commit will **update getting started documentation** +- If applied, this commit will **remove deprecated methods** +- If applied, this commit will **release version 1.0.0** +- If applied, this commit will **merge pull request #123 from user/branch** Notice how this doesn’t work for the other non-imperative forms: -- If applied, this commit will **fixed bug with Y** -- If applied, this commit will **change the behaviour of X** -- If applied, this commit will **more fixes for broken stuff** -- If applied, this commit will **sweet new API methods** +- If applied, this commit will **fixed bug with Y** +- If applied, this commit will **change the behaviour of X** +- If applied, this commit will **more fixes for broken stuff** +- If applied, this commit will **sweet new API methods** Below is an example of the subject line for a pull request: -**feat(alerts): add slack support to alerts** - -**fix(csgoserver): remove SteamCMD auth requirement 32-bit workaround** +- feat(alerts): add slack support to alerts +- fix(csgoserver): remove SteamCMD auth requirement 32-bit workaround ### Testing @@ -211,10 +210,10 @@ Labels to help pinpoint what the issue or PR relates to. variants: -- _distro_ -- _engine_ -- _game_ -- _info_ +- _distro_ +- _engine_ +- _game_ +- _info_ **outcome** Labels Labels that identify why an issue was closed. diff --git a/LICENSE.md b/LICENSE.md index 344a8fb48..c138f4071 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # The MIT License (MIT) -Copyright (c) 2012-2024 Daniel Gibbs +Copyright (c) 2012-2026 Daniel Gibbs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 4075a4e3d..ad8847133 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@

- LinuxGSM - Codacy grade - GitHub Workflow Status - Discord - SteamCMD - MIT License + LinuxGSM + Codacy grade + GitHub Workflow Status + Discord + SteamCMD + MIT License

[LinuxGSM](https://linuxgsm.com) is the command-line tool for quick, simple deployment and management of Linux dedicated game servers. @@ -17,21 +17,21 @@ Traditionally game servers are not easy to manage yourself. Admins often have to 100+ game servers supported -- :truck: Installer -- :mag: Monitor -- :phone: Alerts -- :cloud: Updater -- :blue_book: Server Details -- :floppy_disk: Backup -- :computer: Console +- :truck: Installer +- :mag: Monitor +- :phone: Alerts +- :cloud: Updater +- :blue_book: Server Details +- :floppy_disk: Backup +- :computer: Console ## :penguin: Compatibility LinuxGSM will run on popular distros as long as the minimum requirements are met. -- Ubuntu -- Debian -- CentOS +- Ubuntu +- Debian +- CentOS Other distros are likely to work but are not fully tested. diff --git a/lgsm/config-default/config-lgsm/acserver/_default.cfg b/lgsm/config-default/config-lgsm/acserver/_default.cfg index 154f38c7b..2c4f8c84a 100644 --- a/lgsm/config-default/config-lgsm/acserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/acserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg index a98c90701..8e2f9b272 100644 --- a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg @@ -62,6 +62,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg index 04cc2e6f9..84501a48e 100644 --- a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg index 8680c1bad..0866ac0a0 100644 --- a/lgsm/config-default/config-lgsm/arkserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -59,6 +59,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/arma3server/_default.cfg b/lgsm/config-default/config-lgsm/arma3server/_default.cfg index b0918ef3c..2db6dc955 100644 --- a/lgsm/config-default/config-lgsm/arma3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/arma3server/_default.cfg @@ -73,6 +73,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/armarserver/_default.cfg b/lgsm/config-default/config-lgsm/armarserver/_default.cfg index 61103d332..e7e8c24f4 100644 --- a/lgsm/config-default/config-lgsm/armarserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/armarserver/_default.cfg @@ -9,7 +9,7 @@ #### Game Server Settings #### # https://community.bistudio.com/wiki/Arma_Reforger:Server_Hosting -# MaxFPS to limit the used Server resouces +# MaxFPS to limit the used Server resources maxfps="60" # Profile Name @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/atsserver/_default.cfg b/lgsm/config-default/config-lgsm/atsserver/_default.cfg index f6d165098..a37b64547 100644 --- a/lgsm/config-default/config-lgsm/atsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/atsserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/avserver/_default.cfg b/lgsm/config-default/config-lgsm/avserver/_default.cfg index 7b225de1f..5220fa4e7 100644 --- a/lgsm/config-default/config-lgsm/avserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/avserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/bb2server/_default.cfg b/lgsm/config-default/config-lgsm/bb2server/_default.cfg index b9250cc5f..c00bd7e7d 100644 --- a/lgsm/config-default/config-lgsm/bb2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bb2server/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/bbserver/_default.cfg b/lgsm/config-default/config-lgsm/bbserver/_default.cfg index 99262d8e3..5453a35f1 100644 --- a/lgsm/config-default/config-lgsm/bbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bbserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/bdserver/_default.cfg b/lgsm/config-default/config-lgsm/bdserver/_default.cfg index 3c1769fb3..ac5df16ae 100644 --- a/lgsm/config-default/config-lgsm/bdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bdserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg index 30e2f957a..69c4ba727 100644 --- a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg index 53aa36054..7a28076b0 100644 --- a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -123,8 +133,8 @@ stopmode="3" # 3: gamedig # 4: gsquery # 5: tcp -querymode="1" -querytype="" +querymode="3" +querytype="protocol-gamespy2" ## Console type consoleverbose="yes" diff --git a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg index e353d57b0..f4946bf34 100644 --- a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/boserver/_default.cfg b/lgsm/config-default/config-lgsm/boserver/_default.cfg index ae7912ab6..7eba6c82a 100644 --- a/lgsm/config-default/config-lgsm/boserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/boserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/bsserver/_default.cfg b/lgsm/config-default/config-lgsm/bsserver/_default.cfg index d81cde16d..865e8cf20 100644 --- a/lgsm/config-default/config-lgsm/bsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bsserver/_default.cfg @@ -67,6 +67,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/btlserver/_default.cfg b/lgsm/config-default/config-lgsm/btlserver/_default.cfg index 28e8b95e3..a95a7e77c 100644 --- a/lgsm/config-default/config-lgsm/btlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btlserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/btserver/_default.cfg b/lgsm/config-default/config-lgsm/btserver/_default.cfg index 71c02c3fc..e12b1dfa3 100644 --- a/lgsm/config-default/config-lgsm/btserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ccserver/_default.cfg b/lgsm/config-default/config-lgsm/ccserver/_default.cfg index 66847b410..dcd65011d 100644 --- a/lgsm/config-default/config-lgsm/ccserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ccserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ckserver/_default.cfg b/lgsm/config-default/config-lgsm/ckserver/_default.cfg index f54d7cc7f..35f36dbf5 100644 --- a/lgsm/config-default/config-lgsm/ckserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ckserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg index 776b06a1d..bd81c0cdc 100644 --- a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/cod2server/_default.cfg b/lgsm/config-default/config-lgsm/cod2server/_default.cfg index 9665a9ba8..f33d207cf 100644 --- a/lgsm/config-default/config-lgsm/cod2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod2server/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/cod4server/_default.cfg b/lgsm/config-default/config-lgsm/cod4server/_default.cfg index f9787c352..e2fee45b1 100644 --- a/lgsm/config-default/config-lgsm/cod4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod4server/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/codserver/_default.cfg b/lgsm/config-default/config-lgsm/codserver/_default.cfg index 8f1476ad3..364096768 100644 --- a/lgsm/config-default/config-lgsm/codserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg index c405966d4..0a8da94a9 100644 --- a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg index ca0f002d3..ce6bba88e 100644 --- a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/colserver/_default.cfg b/lgsm/config-default/config-lgsm/colserver/_default.cfg index cd94e9b37..4a560cebb 100644 --- a/lgsm/config-default/config-lgsm/colserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/colserver/_default.cfg @@ -51,6 +51,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/cs2server/_default.cfg b/lgsm/config-default/config-lgsm/cs2server/_default.cfg index dca9194f4..8d65b5364 100644 --- a/lgsm/config-default/config-lgsm/cs2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cs2server/_default.cfg @@ -62,6 +62,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -163,8 +173,8 @@ glibc="2.31" ## Game Server Directories systemdir="${serverfiles}/game/csgo" -executabledir="${serverfiles}/game/bin/linuxsteamrt64" -executable="./cs2" +executabledir="${serverfiles}/game" +executable="./cs2.sh" servercfgdir="${systemdir}/cfg" servercfg="${selfname}.cfg" servercfgdefault="server.cfg" diff --git a/lgsm/config-default/config-lgsm/csczserver/_default.cfg b/lgsm/config-default/config-lgsm/csczserver/_default.cfg index 29001a098..f5d90a35b 100644 --- a/lgsm/config-default/config-lgsm/csczserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csczserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg index 29b3aea10..6ae89331f 100644 --- a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -94,6 +94,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/csserver/_default.cfg b/lgsm/config-default/config-lgsm/csserver/_default.cfg index 266448e74..2ca833c87 100644 --- a/lgsm/config-default/config-lgsm/csserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/cssserver/_default.cfg b/lgsm/config-default/config-lgsm/cssserver/_default.cfg index 103c30897..a396678ff 100644 --- a/lgsm/config-default/config-lgsm/cssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cssserver/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ctserver/_default.cfg b/lgsm/config-default/config-lgsm/ctserver/_default.cfg index ac87d7516..c90d6125c 100644 --- a/lgsm/config-default/config-lgsm/ctserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ctserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dabserver/_default.cfg b/lgsm/config-default/config-lgsm/dabserver/_default.cfg index 3d5015808..28c4478fd 100644 --- a/lgsm/config-default/config-lgsm/dabserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dabserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dayzserver/_default.cfg b/lgsm/config-default/config-lgsm/dayzserver/_default.cfg index f09d23c23..7e84df534 100644 --- a/lgsm/config-default/config-lgsm/dayzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dayzserver/_default.cfg @@ -73,6 +73,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg index 3d74fca4d..9d40dd637 100644 --- a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dodrserver/_default.cfg b/lgsm/config-default/config-lgsm/dodrserver/_default.cfg index 0565b94e9..3c16fcdd5 100644 --- a/lgsm/config-default/config-lgsm/dodrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodrserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dodserver/_default.cfg b/lgsm/config-default/config-lgsm/dodserver/_default.cfg index e2419289a..8f3845911 100644 --- a/lgsm/config-default/config-lgsm/dodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg index b6973f0a7..4f113a64f 100644 --- a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/doiserver/_default.cfg b/lgsm/config-default/config-lgsm/doiserver/_default.cfg index 9a06b7b02..65ee56f1e 100644 --- a/lgsm/config-default/config-lgsm/doiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/doiserver/_default.cfg @@ -59,6 +59,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dstserver/_default.cfg b/lgsm/config-default/config-lgsm/dstserver/_default.cfg index 2c8de8bd4..7c8f3fa30 100644 --- a/lgsm/config-default/config-lgsm/dstserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dstserver/_default.cfg @@ -60,6 +60,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dysserver/_default.cfg b/lgsm/config-default/config-lgsm/dysserver/_default.cfg index fcb37c41a..b65d0ba47 100644 --- a/lgsm/config-default/config-lgsm/dysserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dysserver/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg index c08f37072..c68902ffc 100644 --- a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg @@ -8,8 +8,11 @@ #### Game Server Settings #### +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +usertoken="" + ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-nogui" +startparameters="-nogui -userToken=${usertoken}" #### LinuxGSM Settings #### @@ -50,6 +53,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/emserver/_default.cfg b/lgsm/config-default/config-lgsm/emserver/_default.cfg index 1762e5175..e8f537aab 100644 --- a/lgsm/config-default/config-lgsm/emserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/emserver/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/etlserver/_default.cfg b/lgsm/config-default/config-lgsm/etlserver/_default.cfg index 11a408fb8..9679a8f44 100644 --- a/lgsm/config-default/config-lgsm/etlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/etlserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -131,7 +141,7 @@ consoleinteract="yes" # Do not edit gamename="ET: Legacy" engine="idtech3" -glibc="2.7" +glibc="2.17" #### Directories #### # Edit with care @@ -150,7 +160,7 @@ backupdir="${lgsmdir}/backup" ## Logging Directories [ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" -gamelogdir="${serverfiles}/Logs" +gamelogdir="${serverfiles}/legacy" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" lgsmlog="${lgsmlogdir}/${selfname}-script.log" diff --git a/lgsm/config-default/config-lgsm/ets2server/_default.cfg b/lgsm/config-default/config-lgsm/ets2server/_default.cfg index 6abe98fb3..116de6b6d 100644 --- a/lgsm/config-default/config-lgsm/ets2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ets2server/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg index 284fafaec..6eeeda637 100644 --- a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/fofserver/_default.cfg b/lgsm/config-default/config-lgsm/fofserver/_default.cfg index 7ce630310..857c596a2 100644 --- a/lgsm/config-default/config-lgsm/fofserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fofserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg index 2cc683d20..852094b7c 100644 --- a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg @@ -68,6 +68,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/hcuserver/_default.cfg b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg index 0925fe384..2340506a9 100644 --- a/lgsm/config-default/config-lgsm/hcuserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg @@ -65,6 +65,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg index c429a6c8e..55f1c3918 100644 --- a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg @@ -9,6 +9,8 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# Note that for HL2DM, maxplayers > 33 must be specified like so: +# maxplayers="101 -unrestricted_maxplayers" ip="0.0.0.0" port="27015" clientport="27005" @@ -58,6 +60,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg index 3bddb128e..84d7ca030 100644 --- a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg index 74321c1f4..c1de9618d 100644 --- a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg index 7fe1a4969..70c08c204 100644 --- a/lgsm/config-default/config-lgsm/hwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -68,6 +68,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/hzserver/_default.cfg b/lgsm/config-default/config-lgsm/hzserver/_default.cfg index b610594e7..d2e63e692 100644 --- a/lgsm/config-default/config-lgsm/hzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hzserver/_default.cfg @@ -12,7 +12,6 @@ ip="0.0.0.0" port="7777" queryport="27015" -servername="LinuxGSM" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="-log -port=${port} -queryport=${queryport} -steamservername=${servername}" @@ -56,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -154,11 +163,11 @@ glibc="2.17" # Edit with care ## Game Server Directories -systemdir="${serverfiles}/TSSGame" +systemdir="${serverfiles}/HumanitZServer" executabledir="${systemdir}/Binaries/Linux" -executable="./TSSGameServer-Linux-Shipping" -servercfgdir="${systemdir}/Saved/Config/LinuxServer" -servercfg="GameUserSettings.ini" +executable="./HumanitZServer-Linux-Shipping" +servercfgdir="${systemdir}" +servercfg="GameServerSettings.ini" servercfgdefault="GameUserSettings.ini" servercfgfullpath="${servercfgdir}/${servercfg}" diff --git a/lgsm/config-default/config-lgsm/insserver/_default.cfg b/lgsm/config-default/config-lgsm/insserver/_default.cfg index cd1d13029..74760c2e0 100644 --- a/lgsm/config-default/config-lgsm/insserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/insserver/_default.cfg @@ -64,6 +64,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index 4049e5e11..60f138093 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -67,6 +67,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/iosserver/_default.cfg b/lgsm/config-default/config-lgsm/iosserver/_default.cfg index ff6764d0b..30c41d1fa 100644 --- a/lgsm/config-default/config-lgsm/iosserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/iosserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/jc2server/_default.cfg b/lgsm/config-default/config-lgsm/jc2server/_default.cfg index 5a82bbad9..fe3f28dff 100644 --- a/lgsm/config-default/config-lgsm/jc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc2server/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/jc3server/_default.cfg b/lgsm/config-default/config-lgsm/jc3server/_default.cfg index 62d9cd4ab..faa4f0a09 100644 --- a/lgsm/config-default/config-lgsm/jc3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc3server/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/jk2server/_default.cfg b/lgsm/config-default/config-lgsm/jk2server/_default.cfg index f238c45fe..ef0a54ad8 100644 --- a/lgsm/config-default/config-lgsm/jk2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jk2server/_default.cfg @@ -59,6 +59,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/kf2server/_default.cfg b/lgsm/config-default/config-lgsm/kf2server/_default.cfg index 8f44458cd..b6e39b1ed 100644 --- a/lgsm/config-default/config-lgsm/kf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/kf2server/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/kfserver/_default.cfg b/lgsm/config-default/config-lgsm/kfserver/_default.cfg index 222ba9979..77507e436 100644 --- a/lgsm/config-default/config-lgsm/kfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/kfserver/_default.cfg @@ -62,6 +62,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg index a37ef4eb4..5e6dcfc4e 100644 --- a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg index dc22bc871..4039df849 100644 --- a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg index d7171a3f6..49ac842a6 100644 --- a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg @@ -53,6 +53,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/mcserver/_default.cfg b/lgsm/config-default/config-lgsm/mcserver/_default.cfg index 1288fab95..20ede8c01 100644 --- a/lgsm/config-default/config-lgsm/mcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcserver/_default.cfg @@ -59,6 +59,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/mcvserver/_default.cfg b/lgsm/config-default/config-lgsm/mcvserver/_default.cfg new file mode 100644 index 000000000..3d822892a --- /dev/null +++ b/lgsm/config-default/config-lgsm/mcvserver/_default.cfg @@ -0,0 +1,189 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +game_type="0" +game_mode="0" +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +steamport="26901" +defaultmap="mcv_siege" +maxplayers="32" +tickrate="64" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game vietnam -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +game_type ${game_type} +game_mode ${game_mode} -nobreakpad" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Alert on Start/Stop/Restart +statusalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="1136190" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Military Conflict: Vietnam" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/vietnam" +executabledir="${serverfiles}" +executable="./srcds_run_x64" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/mhserver/_default.cfg b/lgsm/config-default/config-lgsm/mhserver/_default.cfg index 197440ab2..4414621fa 100644 --- a/lgsm/config-default/config-lgsm/mhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mhserver/_default.cfg @@ -59,6 +59,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg index dfd87335c..5784ceede 100644 --- a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/momserver/_default.cfg b/lgsm/config-default/config-lgsm/momserver/_default.cfg index 5834670c9..44eef19e7 100644 --- a/lgsm/config-default/config-lgsm/momserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/momserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg index d1880ef89..7bba9fc10 100644 --- a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg @@ -53,6 +53,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ndserver/_default.cfg b/lgsm/config-default/config-lgsm/ndserver/_default.cfg index 249556af4..3ef7000cd 100644 --- a/lgsm/config-default/config-lgsm/ndserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ndserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/necserver/_default.cfg b/lgsm/config-default/config-lgsm/necserver/_default.cfg index 8062f8d5f..648e0a40c 100644 --- a/lgsm/config-default/config-lgsm/necserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/necserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Pre-defined Paramters | https://docs.linuxgsm.com/configuration/start-parameters#predefined-parameters +## Pre-defined Parameters | https://docs.linuxgsm.com/configuration/start-parameters#predefined-parameters worldname="MyWorld" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters @@ -53,6 +53,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg index 8757caa6c..330160428 100644 --- a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg index 2f8f47af5..565187394 100644 --- a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -19,7 +19,7 @@ httppassword="CHANGE_ME" httpport="8080" mods="" serverpassword="" -# Add the following line to the parms if you want a private server. Ensuring +# Add the following line to the params if you want a private server. Ensuring # that the password variable above is not left empty. # -password \"${serverpassword}\" @@ -65,6 +65,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index 9cec798da..8964f1dfd 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -20,7 +20,7 @@ httppassword="CHANGE_ME" httpport="8080" modserverport="27031" serverpassword="" -# Add the following line to the parms if you want a private server. Ensuring +# Add the following line to the params if you want a private server. Ensuring # that the password variable above is not left empty. # -password '${serverpassword}' @@ -66,6 +66,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/nsserver/_default.cfg b/lgsm/config-default/config-lgsm/nsserver/_default.cfg index 367878519..98fce8ae9 100644 --- a/lgsm/config-default/config-lgsm/nsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nsserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ohdserver/_default.cfg b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg index 26bc3a30c..6213a365f 100644 --- a/lgsm/config-default/config-lgsm/ohdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg @@ -60,6 +60,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg index 0103ef069..17a6c0767 100644 --- a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg @@ -51,6 +51,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/opforserver/_default.cfg b/lgsm/config-default/config-lgsm/opforserver/_default.cfg index 93d00fc5c..7f025a854 100644 --- a/lgsm/config-default/config-lgsm/opforserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/opforserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pc2server/_default.cfg b/lgsm/config-default/config-lgsm/pc2server/_default.cfg index d4e6ce1d6..ad71870c9 100644 --- a/lgsm/config-default/config-lgsm/pc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/pc2server/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pcserver/_default.cfg b/lgsm/config-default/config-lgsm/pcserver/_default.cfg index c36dfaac6..54dfa4019 100644 --- a/lgsm/config-default/config-lgsm/pcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pcserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pmcserver/_default.cfg b/lgsm/config-default/config-lgsm/pmcserver/_default.cfg index 74e0e7e18..b915a9712 100644 --- a/lgsm/config-default/config-lgsm/pmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pmcserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg index 1e2ca3660..64ee41bb0 100644 --- a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg index 374da3dd1..e3f0bc989 100644 --- a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -59,6 +59,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pwserver/_default.cfg b/lgsm/config-default/config-lgsm/pwserver/_default.cfg index 5e848264e..c9052958a 100644 --- a/lgsm/config-default/config-lgsm/pwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pwserver/_default.cfg @@ -11,7 +11,7 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters servername="LinuxGSM" -# For community servers (serverlist) you need to change these settings (publicip & publicport) in the gameserver config file aswell +# For community servers (serverlist) you need to change these settings (publicip & publicport) in the gameserver config file as well port="8211" steamport="27015" @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pzserver/_default.cfg b/lgsm/config-default/config-lgsm/pzserver/_default.cfg index f830d7cc4..aa0ca6525 100644 --- a/lgsm/config-default/config-lgsm/pzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pzserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/q2server/_default.cfg b/lgsm/config-default/config-lgsm/q2server/_default.cfg index 79820d650..5b40936e1 100644 --- a/lgsm/config-default/config-lgsm/q2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q2server/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/q3server/_default.cfg b/lgsm/config-default/config-lgsm/q3server/_default.cfg index 74b0d11f3..35e612651 100644 --- a/lgsm/config-default/config-lgsm/q3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q3server/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/q4server/_default.cfg b/lgsm/config-default/config-lgsm/q4server/_default.cfg index d07828e9f..32293c955 100644 --- a/lgsm/config-default/config-lgsm/q4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q4server/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/qlserver/_default.cfg b/lgsm/config-default/config-lgsm/qlserver/_default.cfg index 84631b765..e1c8d2fac 100644 --- a/lgsm/config-default/config-lgsm/qlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qlserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/qwserver/_default.cfg b/lgsm/config-default/config-lgsm/qwserver/_default.cfg index 620943c3e..39cce3204 100644 --- a/lgsm/config-default/config-lgsm/qwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qwserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg index bb1957de0..b97ff5b7f 100644 --- a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/roserver/_default.cfg b/lgsm/config-default/config-lgsm/roserver/_default.cfg index 0af49a0d4..10eb081bd 100644 --- a/lgsm/config-default/config-lgsm/roserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/roserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg index 9011bbced..b8d3e1eb7 100644 --- a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index cf609a84c..c5823b5f1 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -70,6 +70,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/rwserver/_default.cfg b/lgsm/config-default/config-lgsm/rwserver/_default.cfg index 9523dd63b..2d95710e1 100644 --- a/lgsm/config-default/config-lgsm/rwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rwserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sampserver/_default.cfg b/lgsm/config-default/config-lgsm/sampserver/_default.cfg index 870603bb0..3caf0a4f2 100644 --- a/lgsm/config-default/config-lgsm/sampserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sampserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg index 82d651ec3..2bd551530 100644 --- a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sbserver/_default.cfg b/lgsm/config-default/config-lgsm/sbserver/_default.cfg index 3d06b4235..671e09b31 100644 --- a/lgsm/config-default/config-lgsm/sbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/scpslserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg index 237bbebe3..02140723b 100644 --- a/lgsm/config-default/config-lgsm/scpslserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg index e54814df2..1ca04be52 100644 --- a/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg index 0a091dae4..985b29643 100644 --- a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -53,6 +53,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg index 831f92353..4b5c3bc91 100644 --- a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg index d6ce41d82..4e7272b47 100644 --- a/lgsm/config-default/config-lgsm/sfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg @@ -12,11 +12,12 @@ ip="0.0.0.0" queryport="15777" beaconport="15000" +reliableport="8888" port="7777" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Game Server Docs | https://satisfactory.fandom.com/wiki/Dedicated_servers -startparameters="FactoryGame -Port=${port} -ServerQueryPort=${queryport} -BeaconPort=${beaconport} -log" +startparameters="FactoryGame -Port=${port} -ServerQueryPort=${queryport} -BeaconPort=${beaconport} -ReliablePort=${reliableport} -log" #### LinuxGSM Settings #### @@ -57,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/smserver/_default.cfg b/lgsm/config-default/config-lgsm/smserver/_default.cfg index 306179b9c..4fd669e9b 100644 --- a/lgsm/config-default/config-lgsm/smserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/smserver/_default.cfg @@ -61,6 +61,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sof2server/_default.cfg b/lgsm/config-default/config-lgsm/sof2server/_default.cfg index e00afefa1..70783da4a 100644 --- a/lgsm/config-default/config-lgsm/sof2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/sof2server/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -142,7 +152,7 @@ glibc="2.1" # Edit with care ## Game Server Directories -systemdir="${serverfiles}/main" +systemdir="${serverfiles}/base" executabledir="${serverfiles}" executable="./sof2ded" servercfgdir="${systemdir}" diff --git a/lgsm/config-default/config-lgsm/solserver/_default.cfg b/lgsm/config-default/config-lgsm/solserver/_default.cfg index 8581104dd..06147b620 100644 --- a/lgsm/config-default/config-lgsm/solserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/solserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/psserver/_default.cfg b/lgsm/config-default/config-lgsm/squad44server/_default.cfg similarity index 96% rename from lgsm/config-default/config-lgsm/psserver/_default.cfg rename to lgsm/config-default/config-lgsm/squad44server/_default.cfg index 80d991f94..36037a113 100644 --- a/lgsm/config-default/config-lgsm/psserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/squad44server/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/squadserver/_default.cfg b/lgsm/config-default/config-lgsm/squadserver/_default.cfg index 99b91b538..db783c810 100644 --- a/lgsm/config-default/config-lgsm/squadserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/squadserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/stnserver/_default.cfg b/lgsm/config-default/config-lgsm/stnserver/_default.cfg index 70c7d290c..4fef17c4b 100644 --- a/lgsm/config-default/config-lgsm/stnserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stnserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index 2f2fe0ed4..4aeaa9c8d 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -9,11 +9,11 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters -worldname="moon_save" +worldsave="moon_save" worldtype="Moon" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-LOADLATEST ${worldname} ${worldtype}" +startparameters="-LOAD ${worldsave} ${worldtype}" #### LinuxGSM Settings #### @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/svenserver/_default.cfg b/lgsm/config-default/config-lgsm/svenserver/_default.cfg index 4cd97c50e..24ea8bf66 100644 --- a/lgsm/config-default/config-lgsm/svenserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/svenserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg index fc0d291c9..557ad48af 100644 --- a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg new file mode 100644 index 000000000..fdbcc2cba --- /dev/null +++ b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg @@ -0,0 +1,207 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# Note that for TF2, maxplayers > 33 must be specified like so: +# maxplayers="101 -unrestricted_maxplayers" +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="4koth_frigid" +maxplayers="16" + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game tf2classified -tf_path ${supportdir} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Alert on Start/Stop/Restart +statusalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help all". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +telegramthreadid="" +telegramsilentnotification="false" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +baseappid="232250" +appid="3557020" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Team Fortress 2 Classified" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/tf2classified" +supportdir="${serverfiles}/tf2" +executabledir="${serverfiles}" +executable="./srcds.sh" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/tf2server/_default.cfg b/lgsm/config-default/config-lgsm/tf2server/_default.cfg index 600249013..16a4285f0 100644 --- a/lgsm/config-default/config-lgsm/tf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/tf2server/_default.cfg @@ -9,6 +9,8 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# Note that for TF2, maxplayers > 33 must be specified like so: +# maxplayers="101 -unrestricted_maxplayers" ip="0.0.0.0" port="27015" clientport="27005" @@ -63,6 +65,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg index 17787eef5..ec2e2cade 100644 --- a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/tfserver/_default.cfg b/lgsm/config-default/config-lgsm/tfserver/_default.cfg index fbce96a44..880e12acb 100644 --- a/lgsm/config-default/config-lgsm/tfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfserver/_default.cfg @@ -33,7 +33,7 @@ servertags="LinuxGSM" steamsocket="0" # Use Steam Socket. 0 = off; 1 = on. Use Steam Servers for network penetration. Enable this if you don't have a public IP but you want to allow players from outside your network to join your server. If disabled, only you and other players on your LAN can join. If you have a public IP, you do not need to enable this. ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="ProjectWar_Start?DedicatedServer?MaxPlayers=${maxplayers} -server -game -log -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -BeaconPort=${beaconport} -ShutDownServicePort=${shutdownport} -ConfigServerName='${selfname}' -OutIPAddress=${publicip} -ServerTags='${servertags}' -UseSteamSocket=${steamsocket} -UserDir='${serverfiles}/${selfname}' -ServerName='${servername}' -EnableParallelCharacterMovementTickFunction -EnableParallelCharacterTickFunction -UseDynamicPhysicsScene -Game.PhysicsVehicle=false -ansimalloc -Game.MaxFrameRate=35 -MaxQueueSize=${maxqueuesize} -QueueValidTime=${queuevalidtime} -QueueThreshold=${maxplayers} -ServerFightModeType=${gamemode} -IsCanSelfDamage=${damageself} -IsCanFriendDamage=${damageallies} -SaveWorldInterval=${saveinterval} -GMOverlapRatio=2 -GreenHand=${greenhand} -SensitiveWords=${allowsensitivewords} -UseACE=${anticheat} -ServerAdminAccounts='${serveradmins}' -IsShowGmTitle=${adminlabel} -ServerPassword='${serverpassword}'" +startparameters="ProjectWar_Start?DedicatedServer?MaxPlayers=${maxplayers} -server -game -log -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -BeaconPort=${beaconport} -ShutDownServicePort=${shutdownport} -ConfigServerName='${selfname}' -OutIPAddress=${publicip} -ServerTags='${servertags}' -UseSteamSocket=${steamsocket} -UserDir='${serverfiles}/${selfname}' -ServerName='${servername}' -EnableParallelCharacterMovementTickFunction -EnableParallelCharacterTickFunction -UseDynamicPhysicsScene -Game.PhysicsVehicle=false -ansimalloc -Game.MaxFrameRate=35 -MaxQueueSize=${maxqueuesize} -QueueValidTime=${queuevalidtime} -QueueThreshold=${maxplayers} -ServerFightModeType=${gamemode} -IsCanSelfDamage=${damageself} -IsCanFriendDamage=${damageallies} -SaveWorldInterval=${saveinterval} -GMOverlapRatio=2 -GreenHand=${greenhand} -SensitiveWords=${allowsensitivewords} -UseEAC=${anticheat} -ServerAdminAccounts='${serveradmins}' -IsShowGmTitle=${adminlabel} -ServerPassword='${serverpassword}'" #### LinuxGSM Settings #### @@ -74,6 +74,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/tiserver/_default.cfg b/lgsm/config-default/config-lgsm/tiserver/_default.cfg index 4090d85c9..75aa946f0 100644 --- a/lgsm/config-default/config-lgsm/tiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tiserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ts3server/_default.cfg b/lgsm/config-default/config-lgsm/ts3server/_default.cfg index d132d5c57..87cd0dc31 100644 --- a/lgsm/config-default/config-lgsm/ts3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ts3server/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -133,7 +143,7 @@ consoleinteract="no" ## Game Server Details # Do not edit gamename="TeamSpeak 3" -servername="TeamSpeak 3 Server" +servername="LinuxGSM" engine="null" glibc="2.17" diff --git a/lgsm/config-default/config-lgsm/tsserver/_default.cfg b/lgsm/config-default/config-lgsm/tsserver/_default.cfg index 418727ae6..b3e9799d6 100644 --- a/lgsm/config-default/config-lgsm/tsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tsserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/tuserver/_default.cfg b/lgsm/config-default/config-lgsm/tuserver/_default.cfg index ba22c5aa6..a4e7acaf8 100644 --- a/lgsm/config-default/config-lgsm/tuserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tuserver/_default.cfg @@ -60,6 +60,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/twserver/_default.cfg b/lgsm/config-default/config-lgsm/twserver/_default.cfg index 4d47cb2d1..ea512f271 100644 --- a/lgsm/config-default/config-lgsm/twserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/twserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg index a556c1758..7dd97e269 100644 --- a/lgsm/config-default/config-lgsm/untserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -64,6 +64,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg index ef8fab731..37b219ece 100644 --- a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ut3server/_default.cfg b/lgsm/config-default/config-lgsm/ut3server/_default.cfg index 22817e40c..1d7ecf269 100644 --- a/lgsm/config-default/config-lgsm/ut3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut3server/_default.cfg @@ -70,6 +70,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ut99server/_default.cfg b/lgsm/config-default/config-lgsm/ut99server/_default.cfg index 3343afc81..62b4abc57 100644 --- a/lgsm/config-default/config-lgsm/ut99server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut99server/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/utserver/_default.cfg b/lgsm/config-default/config-lgsm/utserver/_default.cfg index 299d2571a..401cded1a 100644 --- a/lgsm/config-default/config-lgsm/utserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/utserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index b027d0fca..8380e7c16 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -91,6 +91,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -174,8 +184,12 @@ stopmode="2" # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" + +# Deeper monitoring is possible when the server is public and not using Crossplay: +# querymode="2" +# querytype="protocol-valve" ## Console type consoleverbose="yes" diff --git a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg index a3bc472c4..ed57b6d84 100644 --- a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg @@ -12,7 +12,7 @@ startparameters="--dataPath ${servercfgdir}" ## Release Settings | https://docs.linuxgsm.com/game-servers/vintagestory#release-settings -# Branch (stable|unstable) +# Branch (stable|unstable|) branch="stable" #### LinuxGSM Settings #### @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg index 28bc1b2ea..6bccc92fd 100644 --- a/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/vsserver/_default.cfg b/lgsm/config-default/config-lgsm/vsserver/_default.cfg index c7976b384..9414c6978 100644 --- a/lgsm/config-default/config-lgsm/vsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vsserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/wetserver/_default.cfg b/lgsm/config-default/config-lgsm/wetserver/_default.cfg index b53a0674c..fdd42aaf9 100644 --- a/lgsm/config-default/config-lgsm/wetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wetserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/wfserver/_default.cfg b/lgsm/config-default/config-lgsm/wfserver/_default.cfg index d59790ca5..adde08321 100644 --- a/lgsm/config-default/config-lgsm/wfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wfserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/wmcserver/_default.cfg b/lgsm/config-default/config-lgsm/wmcserver/_default.cfg index c9a0a5d52..d5ff2893f 100644 --- a/lgsm/config-default/config-lgsm/wmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wmcserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg index 0141e7d7e..d65df817f 100644 --- a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg @@ -94,6 +94,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/xntserver/_default.cfg b/lgsm/config-default/config-lgsm/xntserver/_default.cfg index 402e6188f..d7b85f58a 100644 --- a/lgsm/config-default/config-lgsm/xntserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/xntserver/_default.cfg @@ -52,6 +52,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg index 391d83baf..b2c61b9fd 100644 --- a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg index b5a7b3b93..c43b008b5 100644 --- a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 86a3b9ce7..e02ca7858 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,java-21-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-compat-libs,libxml2 @@ -83,7 +84,6 @@ opfor pc pc2 pmc,java-21-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -110,12 +110,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 6f08d0b36..5a6d996e7 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,java-21-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-compat-libs,libxml2 @@ -83,7 +84,6 @@ opfor pc pc2 pmc,java-21-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -110,12 +110,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 4143d2471..c5632722e 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,java-21-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-libs,libxml2 @@ -83,7 +84,6 @@ opfor pc pc2 pmc,java-11-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -110,12 +110,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-11-openjdk vs wet diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index bfee184a9..0b0b766d0 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,java-21-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-compat-libs,libxml2 @@ -83,7 +84,6 @@ opfor pc pc2 pmc,java-17-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -110,12 +110,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 3bd65d6f8..fd9c0fa39 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,java-17-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-compat-libs,libxml2 @@ -83,7 +84,6 @@ opfor pc pc2 pmc,java-17-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -110,12 +110,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index afd1833b3..5b8d73a06 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -67,6 +67,7 @@ l4d l4d2 mc,openjdk-11-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -82,7 +83,7 @@ opfor pc pc2 pmc,openjdk-11-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw @@ -112,10 +113,11 @@ squad st,libxml2-utils steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index ef1e1fdb2..adba97d27 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,openjdk-17-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -83,7 +84,7 @@ opfor pc pc2 pmc,openjdk-17-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw @@ -112,10 +113,11 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 8b26edc99..40e325b6c 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,openjdk-17-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -83,7 +84,7 @@ opfor pc pc2 pmc,openjdk-17-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw @@ -116,6 +117,7 @@ sven,libssl3:i386,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-10.0 vpmc,openjdk-17-jre vs wet diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index 5ae5ebc0a..d53dfb44f 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -11,7 +11,7 @@ av bb bb2,libcurl4-gnutls-dev:i386 bd -bf1942,libncurses5:i386,libtinfo5:i386 +bf1942,libncurses5:i386 bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo @@ -31,7 +31,7 @@ cs cs2 cscz csgo -css,libtinfo5:i386 +css ct dab dayz @@ -48,7 +48,7 @@ etl ets2 fctr fof -gmod,libtinfo5:i386 +gmod hcu hl2dm hldm @@ -66,14 +66,15 @@ kf kf2 l4d l4d2 -mc,openjdk-22-jre +mc,openjdk-25-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils nd nec -nmrih,libtinfo5:i386 +nmrih ns ns2,speex,libtbb12 ns2c,speex:i386,libtbb12 @@ -82,12 +83,12 @@ onset,libmariadb-dev opfor pc pc2 -pmc,openjdk-22-jre -ps,libgconf-2-4 +pmc,openjdk-25-jre +squad44 pvkii pvr,libc++1 pw -pz,openjdk-22-jre,rng-tools5 +pz,openjdk-25-jre,rng-tools5 q2 q3 q4 @@ -97,15 +98,15 @@ ricochet ro rtcw rust,lib32z1 -rw,openjdk-22-jre +rw,openjdk-25-jre samp sb sbots -scpsl,mono-complete +scpsl,mono-complete,libicu76 scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf -sfc,libtinfo5:i386 +sfc sm,telnet,expect sof2 sol @@ -116,6 +117,7 @@ sven,libssl3:i386,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts @@ -128,13 +130,13 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 -vpmc,openjdk-21-jre +vints,dotnet-runtime-10.0 +vpmc,openjdk-25-jre vs wet wf -wmc,openjdk21-jre +wmc,openjdk-25-jre wurm,xvfb xnt -zmr,libtinfo5:i386 -zps,libtinfo5:i386 +zmr +zps diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 91af40e76..c0e990961 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,openjdk-8-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -83,7 +84,7 @@ opfor pc pc2 pmc,openjdk-8-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw @@ -112,10 +113,11 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-8-jre vs wet diff --git a/lgsm/data/gameicons/mcv-icon.png b/lgsm/data/gameicons/mcv-icon.png new file mode 100644 index 000000000..fefcc2346 Binary files /dev/null and b/lgsm/data/gameicons/mcv-icon.png differ diff --git a/lgsm/data/gameicons/ps-icon.png b/lgsm/data/gameicons/ps-icon.png deleted file mode 100644 index afe81e823..000000000 Binary files a/lgsm/data/gameicons/ps-icon.png and /dev/null differ diff --git a/lgsm/data/gameicons/squad44-icon.png b/lgsm/data/gameicons/squad44-icon.png new file mode 100644 index 000000000..0d2a6fc8e Binary files /dev/null and b/lgsm/data/gameicons/squad44-icon.png differ diff --git a/lgsm/data/gameicons/tf2c-icon.png b/lgsm/data/gameicons/tf2c-icon.png new file mode 100644 index 000000000..f466347a1 Binary files /dev/null and b/lgsm/data/gameicons/tf2c-icon.png differ diff --git a/lgsm/data/name-left.csv b/lgsm/data/name-left.csv index 9a47b4baf..2a95f7106 100644 --- a/lgsm/data/name-left.csv +++ b/lgsm/data/name-left.csv @@ -105,4 +105,4 @@ wonderful xenodochial youthful zealous -zen \ No newline at end of file +zen diff --git a/lgsm/data/name-right.csv b/lgsm/data/name-right.csv index 8e04d85b4..3fdbb9278 100644 --- a/lgsm/data/name-right.csv +++ b/lgsm/data/name-right.csv @@ -234,4 +234,4 @@ wright wu yalow yonath -zhukovsky \ No newline at end of file +zhukovsky diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 3b12eae3b..d7801771c 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -69,6 +69,7 @@ l4d l4d2 mc,java-11-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-libs,libxml2 @@ -84,7 +85,6 @@ opfor pc pc2 pmc,java-11-openjdk -ps,GConf2 pvkii pvr,libcxx pz,java-11-openjdk rng-tools @@ -110,12 +110,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-11-openjdk vs wet diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index c862c5897..d65424265 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,java-21-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-compat-libs,libxml2 @@ -83,7 +84,6 @@ opfor pc pc2 pmc,java-21-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -110,12 +110,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 6f08d0b36..5a6d996e7 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,java-21-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-compat-libs,libxml2 @@ -83,7 +84,6 @@ opfor pc pc2 pmc,java-21-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -110,12 +110,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index c862c5897..d65424265 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,java-21-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-compat-libs,libxml2 @@ -83,7 +84,6 @@ opfor pc pc2 pmc,java-21-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -110,12 +110,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 6f08d0b36..5a6d996e7 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,java-21-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-compat-libs,libxml2 @@ -83,7 +84,6 @@ opfor pc pc2 pmc,java-21-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -110,12 +110,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index e662c74f6..3ddc013c3 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -10,8 +10,8 @@ av,avserver,Avorion,ubuntu-24.04 bb,bbserver,BrainBread,ubuntu-24.04 bb2,bb2server,BrainBread 2,ubuntu-24.04 bd,bdserver,Base Defense,ubuntu-24.04 -bf1942,bf1942server,Battlefield 1942,ubuntu-24.04 -bfv,bfvserver,Battlefield: Vietnam,ubuntu-24.04 +bf1942,bf1942server,Battlefield 1942,ubuntu-22.04 +bfv,bfvserver,Battlefield: Vietnam,ubuntu-22.04 bmdm,bmdmserver,Black Mesa: Deathmatch,ubuntu-24.04 bo,boserver,Ballistic Overkill,ubuntu-24.04 bs,bsserver,Blade Symphony,ubuntu-24.04 @@ -67,6 +67,7 @@ l4d,l4dserver,Left 4 Dead,ubuntu-24.04 l4d2,l4d2server,Left 4 Dead 2,ubuntu-24.04 mc,mcserver,Minecraft,ubuntu-24.04 mcb,mcbserver,Minecraft Bedrock,ubuntu-24.04 +mcv,mcvserver,Military Conflict: Vietnam,ubuntu-24.04 mh,mhserver,MORDHAU,ubuntu-24.04 mohaa,mohaaserver,Medal of Honor: Allied Assault,ubuntu-24.04 mta,mtaserver,Multi Theft Auto,ubuntu-24.04 @@ -82,7 +83,6 @@ opfor,opforserver,Opposing Force,ubuntu-24.04 pc,pcserver,Project Cars,ubuntu-24.04 pc2,pc2server,Project Cars 2,ubuntu-24.04 pmc,pmcserver,PaperMC,ubuntu-24.04 -ps,psserver,Post Scriptum,ubuntu-24.04 pvkii,pvkiiserver,Pirates Vikings & Knights II,ubuntu-24.04 pvr,pvrserver,Pavlov VR,ubuntu-24.04 pw,pwserver,Palworld,ubuntu-24.04 @@ -109,12 +109,14 @@ sm,smserver,Soulmask,ubuntu-24.04 sof2,sof2server,Soldier Of Fortune 2: Gold Edition,ubuntu-24.04 sol,solserver,Soldat,ubuntu-24.04 squad,squadserver,Squad,ubuntu-24.04 +squad44,squad44server,Squad 44,ubuntu-24.04 st,stserver,Stationeers,ubuntu-24.04 stn,stnserver,Survive the Nights,ubuntu-24.04 -sven,svenserver,Sven Co-op,ubuntu-20.04 +sven,svenserver,Sven Co-op,ubuntu-24.04 terraria,terrariaserver,Terraria,ubuntu-24.04 tf,tfserver,The Front,ubuntu-24.04 tf2,tf2server,Team Fortress 2,ubuntu-24.04 +tf2c,tf2cserver,Team Fortress 2 Classified,ubuntu-24.04 tfc,tfcserver,Team Fortress Classic,ubuntu-24.04 ti,tiserver,The Isle,ubuntu-24.04 ts,tsserver,The Specialists,ubuntu-24.04 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 543256f48..24fcf33e2 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -69,6 +69,7 @@ l4d l4d2 mc,openjdk-8-jre mcb +mcv mh mohaa,libstdc++5:i386 mta @@ -84,7 +85,7 @@ opfor pc pc2 pmc,openjdk-8-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pz,openjdk-8-jre,rng-tools @@ -112,10 +113,11 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-8-jre vs wet diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 33e687e38..b283b629a 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -69,6 +69,7 @@ l4d l4d2 mc,openjdk-11-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -84,7 +85,7 @@ opfor pc pc2 pmc,openjdk-11-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pz,openjdk-11-jre,rng-tools @@ -112,10 +113,11 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index c0036d4b0..b086d0095 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,openjdk-21-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -83,7 +84,7 @@ opfor pc pc2 pmc,openjdk-21-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw @@ -112,10 +113,11 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index c1226b012..93bfbd4cf 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,openjdk-21-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -83,7 +84,7 @@ opfor pc pc2 pmc,openjdk-21-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw @@ -112,10 +113,11 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index c4574c7d1..cb871bde0 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,openjdk-21-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -83,7 +84,7 @@ opfor pc pc2 pmc,openjdk-21-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw @@ -112,10 +113,11 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-23.10.csv b/lgsm/data/ubuntu-23.10.csv index c4574c7d1..cb871bde0 100644 --- a/lgsm/data/ubuntu-23.10.csv +++ b/lgsm/data/ubuntu-23.10.csv @@ -68,6 +68,7 @@ l4d l4d2 mc,openjdk-21-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -83,7 +84,7 @@ opfor pc pc2 pmc,openjdk-21-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw @@ -112,10 +113,11 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts @@ -128,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index c4574c7d1..0e010abd6 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -5,15 +5,15 @@ ahl ahl2 ark arma3 -armar,libcurl4 +armar,libcurl4t64 ats av bb bb2,libcurl4-gnutls-dev:i386 bd -bf1942,libncurses5:i386,libtinfo5:i386 -bfv,libncurses5:i386,libstdc++5:i386 -bmdm,libncurses5:i386 +bf1942 +bfv,libstdc++5:i386 +bmdm bo bs bt,libicu-dev,dos2unix,libxml2-utils @@ -31,7 +31,7 @@ cs cs2 cscz csgo -css,libtinfo5:i386 +css ct dab dayz @@ -48,7 +48,7 @@ etl ets2 fctr fof -gmod,libtinfo5:i386 +gmod hcu hl2dm hldm @@ -66,28 +66,28 @@ kf kf2 l4d l4d2 -mc,openjdk-21-jre +mc,openjdk-25-jre mcb +mcv mh mohaa,libstdc++5:i386 -mta,libncursesw5,libxml2-utils +mta,libxml2-utils nd nec -nmrih,libtinfo5:i386 +nmrih ns -ns2,speex,libtbb2 -ns2c,speex:i386,libtbb2 +ns2,speex +ns2c,speex:i386 ohd onset,libmariadb-dev opfor pc pc2 -pmc,openjdk-21-jre -ps,libgconf-2-4 +pmc,openjdk-25-jre pvkii pvr,libc++1 pw -pz,openjdk-21-jre,rng-tools5 +pz,openjdk-25-jre,rng-tools5 q2 q3 q4 @@ -97,7 +97,7 @@ ricochet ro rtcw rust,lib32z1 -rw,openjdk-21-jre +rw,openjdk-25-jre samp sb sbots @@ -105,17 +105,19 @@ scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf -sfc,libtinfo5:i386 +sfc sm,telnet,expect sof2 sol squad +squad44 st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts @@ -128,13 +130,13 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 -vpmc,openjdk-21-jre +vints,dotnet-runtime-10.0 +vpmc,openjdk-25-jre vs wet wf -wmc,openjdk-21-jre +wmc,openjdk-25-jre wurm,xvfb xnt -zmr,libtinfo5:i386 -zps,libtinfo5:i386 +zmr +zps diff --git a/lgsm/data/ubuntu-26.04.csv b/lgsm/data/ubuntu-26.04.csv new file mode 100644 index 000000000..0e010abd6 --- /dev/null +++ b/lgsm/data/ubuntu-26.04.csv @@ -0,0 +1,142 @@ +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat-openbsd,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils +steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd +ac +ahl +ahl2 +ark +arma3 +armar,libcurl4t64 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942 +bfv,libstdc++5:i386 +bmdm +bo +bs +bt,libicu-dev,dos2unix,libxml2-utils +btl +cc +ck,xvfb,libxi6 +cmw +cod,libstdc++5:i386 +cod2,libstdc++5:i386 +cod4 +coduo,libstdc++5:i386 +codwaw +col +cs +cs2 +cscz +csgo +css +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jbep3 +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-25-jre +mcb +mcv +mh +mohaa,libstdc++5:i386 +mta,libxml2-utils +nd +nec +nmrih +ns +ns2,speex +ns2c,speex:i386 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-25-jre +pvkii +pvr,libc++1 +pw +pz,openjdk-25-jre,rng-tools5 +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-25-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc +sm,telnet,expect +sof2 +sol +squad +squad44 +st,libxml2-utils +stn +sven,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,dotnet-runtime-10.0 +vpmc,openjdk-25-jre +vs +wet +wf +wmc,openjdk-25-jre +wurm,xvfb +xnt +zmr +zps diff --git a/lgsm/modules/README.md b/lgsm/modules/README.md index de008ecfa..a0aee384c 100644 --- a/lgsm/modules/README.md +++ b/lgsm/modules/README.md @@ -6,12 +6,12 @@ These modules are scripts that are called upon by the primary script linuxgsm.sh Modules have been named to give an idea of what the function does. -- core: Essential modules that will always run first. -- command: Primary command function. -- check: Runs checks that will either halt on or fix an issue. -- dev: development modules. -- fix: Applies a game server specific fix. -- info: retrieves information from a source such as config file or the OS. -- install: modules related to the installer. -- monitor: modules related to monitor. -- update: modules that update the game server. +- core: Essential modules that will always run first. +- command: Primary command function. +- check: Runs checks that will either halt on or fix an issue. +- dev: development modules. +- fix: Applies a game server specific fix. +- info: retrieves information from a source such as config file or the OS. +- install: modules related to the installer. +- monitor: modules related to monitor. +- update: modules that update the game server. diff --git a/lgsm/modules/alert.sh b/lgsm/modules/alert.sh old mode 100644 new mode 100755 index f2698e3b7..ac7d92d83 --- a/lgsm/modules/alert.sh +++ b/lgsm/modules/alert.sh @@ -10,13 +10,9 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Generates alert log of the details at the time of the alert. # Used with email alerts. fn_alert_log() { - info_distro.sh - info_game.sh - info_messages.sh if [ -f "${alertlog}" ]; then rm -f "${alertlog:?}" fi - { fn_info_messages_head fn_info_messages_distro @@ -97,45 +93,66 @@ fn_alert_monitor_query() { # Update alerts fn_alert_update() { - fn_script_log_info "Sending alert: ${selfname} has received a game server update: ${localbuild}" + # If previousbuild is set show transition, else fallback to single version. + if [ -n "${previousbuild:-}" ] && [ -n "${localbuild:-}" ]; then + fn_script_log_info "Sending alert: ${selfname} updated: ${previousbuild} -> ${localbuild}" + alertmessage="${selfname} updated: ${previousbuild} -> ${localbuild}." + else + fn_script_log_info "Sending alert: ${selfname} updated to ${localbuild}" + alertmessage="${selfname} updated to ${localbuild}." + fi alertaction="Updated" alertemoji="🎉" alertsound="1" - alertmessage="${selfname} has received a game server update: ${localbuild}." # Green alertcolourhex="#00cd00" alertcolourdec="52480" } -fn_alert_update_request() { - fn_script_log_info "Sending alert: ${selfname} has requested an update and needs to be restarted." - alertaction="Updating" +# Update failure alert +fn_alert_update_failed() { + # Expect updatefailureexpected (target version) and updatefailuregot (actual localbuild) if set + local updateexpected="${updatefailureexpected:-${remotebuild:-unknown}}" + local updategot="${updatefailuregot:-${localbuild:-unknown}}" + fn_script_log_error "Sending alert: ${selfname} update failed: expected ${updateexpected}, got ${updategot}" + alertaction="Update Failed" + alertemoji="❌" + alertsound="2" + alertmessage="${selfname} update failed: expected ${updateexpected}, got ${updategot}. Manual intervention required." + # Red + alertcolourhex="#cd0000" + alertcolourdec="13434880" +} + +fn_alert_update_restart_request() { + fn_script_log_info "Sending alert: ${selfname} restart requested" + alertaction="Restart Requested" alertemoji="🎉" alertsound="1" - alertmessage="${selfname} has requested an update and needs to be restarted." + alertmessage="${selfname} has requested a restart for an update to be applied. Restarting now." # Blue alertcolourhex="#1e90ff" alertcolourdec="2003199" } fn_alert_check_update() { - fn_script_log_info "Sending alert: ${gamename} update available: ${remotebuildversion}" - alertaction="Update available" + fn_script_log_info "Sending alert: ${gamename} update available: ${localbuild} -> ${remotebuild}" + alertaction="Update Available" alertemoji="🎉" alertsound="1" - alertmessage="${gamename} update available: ${remotebuildversion}" + alertmessage="${gamename} update available: ${localbuild} -> ${remotebuild}" # Blue alertcolourhex="#1e90ff" alertcolourdec="2003199" } fn_alert_update_linuxgsm() { - fn_script_log_info "Sending alert: ${selfname} has received an LinuxGSM update" + fn_script_log_info "Sending alert: ${selfname} has received a LinuxGSM update" alertaction="Updated" alertemoji="🎉" alertsound="1" alertbody="${gamename} update available" - alertmessage="${selfname} has received an LinuxGSM update and been restarted." + alertmessage="${selfname} has received a LinuxGSM update and been restarted." # Green alertcolourhex="#00cd00" alertcolourdec="52480" @@ -197,8 +214,9 @@ fn_alert_info() { alertcolourdec="2003199" } -# Images -alerticon="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/gameicons/${shortname}-icon.png" +info_distro.sh +info_game.sh +info_messages.sh if [ "${alert}" == "permissions" ]; then fn_alert_permissions @@ -210,8 +228,10 @@ elif [ "${alert}" == "test" ]; then fn_alert_test elif [ "${alert}" == "update" ]; then fn_alert_update -elif [ "${alert}" == "update-request" ]; then - fn_alert_update_request +elif [ "${alert}" == "update-failed" ]; then + fn_alert_update_failed +elif [ "${alert}" == "update-restart-request" ]; then + fn_alert_update_restart_request elif [ "${alert}" == "check-update" ]; then fn_alert_check_update elif [ "${alert}" == "config" ]; then @@ -237,6 +257,7 @@ else fi alerttitle="${alertemoji} ${alertaction} - ${servername} ${alertemoji}" +alerticon="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/gameicons/${shortname}-icon.png" # Generate alert log. fn_alert_log @@ -357,3 +378,14 @@ elif [ -z "${slacktoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then echo -e "* https://docs.linuxgsm.com/alerts/slack" fn_script_error "Slack token not set" fi + +if [ "${ntfyalert}" == "on" ] && [ -n "${ntfytopic}" ]; then + alert_ntfy.sh +elif [ "${ntfyalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "ntfy alerts not enabled" + fn_script_log_warn "ntfy alerts not enabled" +elif [ -z "${ntfytopic}" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "ntfy topic not set" + echo -e "* https://docs.linuxgsm.com/alerts/ntfy" + fn_script_error "ntfy topic not set" +fi diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh old mode 100644 new mode 100755 index 93eda8d5b..e4bf6307f --- a/lgsm/modules/alert_discord.sh +++ b/lgsm/modules/alert_discord.sh @@ -7,28 +7,28 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsoninfo=$( +json=$( cat << EOF { - "username": "LinuxGSM", - "avatar_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "file": "content", - "embeds": [ - { - "author": { - "name": "LinuxGSM Alert", - "url": "", - "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg" - }, - "title": "${alerttitle}", - "url": "", - "description": "", - "color": "${alertcolourdec}", - "type": "content", - "thumbnail": { - "url": "${alerticon}" - }, - "fields": [ + "username": "LinuxGSM", + "avatar_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", + "file": "content", + "embeds": [ + { + "author": { + "name": "LinuxGSM Alert", + "url": "", + "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg" + }, + "title": "${alerttitle}", + "url": "", + "description": "", + "color": "${alertcolourdec}", + "type": "content", + "thumbnail": { + "url": "${alerticon}" + }, + "fields": [ { "name": "Server Name", "value": "${servername}" @@ -37,111 +37,64 @@ jsoninfo=$( "name": "Information", "value": "${alertmessage}" }, - { - "name": "Game", - "value": "${gamename}", - "inline": true - }, - { - "name": "Server IP", - "value": "\`${alertip}:${port}\`", - "inline": true - }, - { - "name": "Hostname", - "value": "${HOSTNAME}", - "inline": true - }, { - "name": "More info", - "value": "${alerturl}", + "name": "Game", + "value": "${gamename}", "inline": true }, - { - "name": "Server Time", - "value": "$(date)", - "inline": true - } - ], - "footer": { - "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "text": "Sent by LinuxGSM ${version}" - } - } - ] -} + { + "name": "Server IP", + "value": "\`${alertip}:${port}\`", + "inline": true + }, + { + "name": "Server Time", + "value": "$(date)", + "inline": true + } EOF ) -jsonnoinfo=$( - cat << EOF -{ - "username": "LinuxGSM", - "avatar_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "file": "content", - "embeds": [ - { - "author": { - "name": "LinuxGSM Alert", - "url": "", - "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg" - }, - "title": "${alerttitle}", - "url": "", - "description": "", - "color": "${alertcolourdec}", - "type": "content", - "thumbnail": { - "url": "${alerticon}" - }, - "fields": [ +if [ -n "${alerturl}" ]; then + json+=$( + cat << EOF + , { - "name": "Server Name", - "value": "${servername}" - }, + "name": "More info", + "value": "${alerturl}", + "inline": true + } +EOF + ) +fi + +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF + , { - "name": "Information", - "value": "${alertmessage}" - }, - { - "name": "Game", - "value": "${gamename}", - "inline": true - }, - { - "name": "Server IP", - "value": "\`${alertip}:${port}\`", - "inline": true - }, - { - "name": "Hostname", - "value": "${HOSTNAME}", - "inline": true - }, - { - "name": "Server Time", - "value": "$(date)", - "inline": true - } - ], - "footer": { + "name": "Is my Game Server Online?", + "value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}" + } +EOF + ) +fi + +json+=$( + cat << EOF + ], + "footer": { "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "text": "Sent by LinuxGSM ${version}" - } - } - ] + "text": "Sent by LinuxGSM ${version}" + } + } + ] } EOF ) fn_print_dots "Sending Discord alert" -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" -fi - discordsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${discordwebhook}") if [ -n "${discordsend}" ]; then diff --git a/lgsm/modules/alert_email.sh b/lgsm/modules/alert_email.sh old mode 100644 new mode 100755 index ca9db1bc4..81c01e25b --- a/lgsm/modules/alert_email.sh +++ b/lgsm/modules/alert_email.sh @@ -15,7 +15,7 @@ else mail -s "${alerttitle}" "${email}" < "${alertlog}" fi exitcode=$? -if [ "${exitcode}" == "0" ]; then +if [ "${exitcode}" -eq 0 ]; then fn_print_ok_nl "Sending Email alert: ${email}" fn_script_log_pass "Sending Email alert: ${email}" else diff --git a/lgsm/modules/alert_gotify.sh b/lgsm/modules/alert_gotify.sh old mode 100644 new mode 100755 index 724ff1d79..647445746 --- a/lgsm/modules/alert_gotify.sh +++ b/lgsm/modules/alert_gotify.sh @@ -5,34 +5,40 @@ # Website: https://linuxgsm.com # Description: Sends Gotify alert. -module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsoninfo=$( +json=$( cat << EOF { "title": "${alerttitle}", - "message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)", - "priority": 5 -} + "message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\n EOF ) -jsonnoinfo=$( +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF +Is my Game Server Online?\nhttps://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}\n\n +EOF + ) +fi + +if [ -n "${alerturl}" ]; then + json+=$( + cat << EOF +More info\n${alerturl}\n\n +EOF + ) +fi + +json+=$( cat << EOF -{ - "title": "${alerttitle}", - "message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)", +Server Time\n$(date)", "priority": 5 } EOF ) -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" -fi - fn_print_dots "Sending Gotify alert" gotifysend=$(curl --connect-timeout 3 -sSL "${gotifywebhook}/message"?token="${gotifytoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)") diff --git a/lgsm/modules/alert_ifttt.sh b/lgsm/modules/alert_ifttt.sh old mode 100644 new mode 100755 index ca1c005d0..59bb8d965 --- a/lgsm/modules/alert_ifttt.sh +++ b/lgsm/modules/alert_ifttt.sh @@ -7,32 +7,38 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsoninfo=$( +json=$( cat << EOF { "value1": "${selfname}", "value2": "${alerttitle}", - "value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)" -} + "value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\n EOF ) -jsonnoinfo=$( +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF +Is my Game Server Online?\nhttps://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}\n\n +EOF + ) +fi + +if [ -n "${alerturl}" ]; then + json+=$( + cat << EOF +More info\n${alerturl}\n\n +EOF + ) +fi + +json+=$( cat << EOF -{ - "value1": "${selfname}", - "value2": "${alerttitle}", - "value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)" +Server Time\n$(date)" } EOF ) -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" -fi - fn_print_dots "Sending IFTTT alert" iftttsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://maker.ifttt.com/trigger/${iftttevent}/with/key/${ifttttoken}" | grep "Bad Request") diff --git a/lgsm/modules/alert_ntfy.sh b/lgsm/modules/alert_ntfy.sh new file mode 100755 index 000000000..3f9b0159e --- /dev/null +++ b/lgsm/modules/alert_ntfy.sh @@ -0,0 +1,107 @@ +#!/bin/bash +# LinuxGSM alert_ntfy.sh module +# Author: Daniel Gibbs (Original Structure), rconjoe (ntfy Adaptation) +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends ntfy alert. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Default ntfy server if not set in config +if [ -z "${ntfyserver}" ]; then + ntfyserver="https://ntfy.sh" +fi + +# Construct the target URL +ntfyurl="${ntfyserver}/${ntfytopic}" + +# Determine priority based on alertsound or config override +# ntfy priorities: 1 (min), 2 (low), 3 (default), 4 (high), 5 (max) +if [ -n "${ntfypriority}" ]; then + priority="${ntfypriority}" +elif [ "${alertsound}" == "2" ]; then + # High priority for monitor failures/permissions issues + priority="4" +else + # Default priority for standard notifications + priority="3" +fi + +# Determine tags based on alertemoji or config override +if [ -n "${ntfytags}" ]; then + tags="${ntfytags}" +else + # Use the alert emoji as a tag + tags="${alertemoji}" +fi + +# Construct the message body (keep formatting consistent with other plain-text alerts) +message="Server Name +${servername} + +Information +${alertmessage} + +Game +${gamename} + +Server IP +${alertip}:${port} + +Server Time +$(date)" + +# Add optional links if available +if [ -n "${querytype}" ]; then + message+="\n\nIs my Game Server Online?\nhttps://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}" +fi + +# Use alerturl for the click action if available +clickurl="" +if [ -n "${alerturl}" ]; then + message+="\n\nMore info\n${alerturl}" + clickurl="${alerturl}" +fi + +# Prepare curl command +# Start with base command and add headers +cmd=(curl --connect-timeout 10 -sS -X POST) +cmd+=(-H "Title: ${alerttitle}") +cmd+=(-H "Priority: ${priority}") +cmd+=(-H "Tags: ${tags}") + +# Add icon if available +if [ -n "${alerticon}" ]; then + cmd+=(-H "Icon: ${alerticon}") +fi + +# Add click URL if available +if [ -n "${clickurl}" ]; then + cmd+=(-H "Click: ${clickurl}") +fi + +# Add authentication header if token is provided +if [ -n "${ntfytoken}" ]; then + cmd+=(-H "Authorization: Bearer ${ntfytoken}") +# Add basic auth if username/password provided (and token isn't) +elif [ -n "${ntfyusername}" ] && [ -n "${ntfypassword}" ]; then + cmd+=(-u "${ntfyusername}:${ntfypassword}") +fi + +# Add message body and target URL +cmd+=(-d "${message}" "${ntfyurl}") + +fn_print_dots "Sending ntfy alert to ${ntfyurl}" + +# Execute the command +ntfysend=$("${cmd[@]}") +exitcode=$? + +# Check exit code and response +if [ "${exitcode}" -eq 0 ] && [[ "${ntfysend}" != *"\"code\":"* ]] && [[ "${ntfysend}" != *"401"* ]] && [[ "${ntfysend}" != *"404"* ]]; then + fn_print_ok_nl "Sending ntfy alert to ${ntfyurl}" + fn_script_log_pass "Sending ntfy alert to ${ntfyurl}" +else + fn_print_fail_nl "Sending ntfy alert to ${ntfyurl}: ${ntfysend} (Exit code: ${exitcode})" + fn_script_log_fail "Sending ntfy alert to ${ntfyurl}: ${ntfysend} (Exit code: ${exitcode})" +fi diff --git a/lgsm/modules/alert_pushbullet.sh b/lgsm/modules/alert_pushbullet.sh old mode 100644 new mode 100755 index 4b96a1f9f..62937b3a7 --- a/lgsm/modules/alert_pushbullet.sh +++ b/lgsm/modules/alert_pushbullet.sh @@ -7,34 +7,39 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsoninfo=$( +json=$( cat << EOF { "channel_tag": "${channeltag}", "type": "note", "title": "${alerttitle}", - "body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)" -} + "body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\n EOF ) -jsonnoinfo=$( +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF +Is my Game Server Online?\nhttps://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}\n\n +EOF + ) +fi + +if [ -n "${alerturl}" ]; then + json+=$( + cat << EOF +More info\n${alerturl}\n\n +EOF + ) +fi + +json+=$( cat << EOF -{ - "channel_tag": "${channeltag}", - "type": "note", - "title": "${alerttitle}", - "body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)" +Server Time\n$(date)" } EOF ) -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" -fi - fn_print_dots "Sending Pushbullet alert" pushbulletsend=$(curl --connect-timeout 3 -sSL -H "Access-Token: ${pushbullettoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://api.pushbullet.com/v2/pushes" | grep "error_code") diff --git a/lgsm/modules/alert_pushover.sh b/lgsm/modules/alert_pushover.sh old mode 100644 new mode 100755 index dc488026a..3437ba83e --- a/lgsm/modules/alert_pushover.sh +++ b/lgsm/modules/alert_pushover.sh @@ -22,12 +22,28 @@ else alertpriority="0" fi -if [ -z "${alerturl}" ]; then - pushoversend=$(curl --connect-timeout 3 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" Server name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

Server Time
$(date)" "https://api.pushover.net/1/messages.json" | grep errors) -else - pushoversend=$(curl --connect-timeout 3 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" Server name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

More info
${alerturl}

Server Time
$(date)" "https://api.pushover.net/1/messages.json" | grep errors) +message=" Server Name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

" + +if [ -n "${querytype}" ]; then + message+="Is my Game Server Online?
Check here

" +fi + +if [ -n "${alerturl}" ]; then + message+="More info
${alerturl}

" fi +message+="Server Time
$(date)" + +pushoversend=$(curl --connect-timeout 3 -sS \ + -F token="${pushovertoken}" \ + -F user="${pushoveruserkey}" \ + -F html="1" \ + -F sound="${alertsound}" \ + -F priority="${alertpriority}" \ + -F title="${alerttitle}" \ + -F message="${message}" \ + "https://api.pushover.net/1/messages.json" | grep errors) + if [ -n "${pushoversend}" ]; then fn_print_fail_nl "Sending Pushover alert: ${pushoversend}" fn_script_log_fail "Sending Pushover alert: ${pushoversend}" diff --git a/lgsm/modules/alert_rocketchat.sh b/lgsm/modules/alert_rocketchat.sh old mode 100644 new mode 100755 index bff2c6a0b..68045221e --- a/lgsm/modules/alert_rocketchat.sh +++ b/lgsm/modules/alert_rocketchat.sh @@ -7,7 +7,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsoninfo=$( +json=$( cat << EOF { "alias": "LinuxGSM", @@ -40,70 +40,40 @@ jsoninfo=$( { "short": false, "title": "Server IP", - "value": "${alertip}:${port}" - }, + "value": "\`${alertip}:${port}\`" + } +EOF +) + +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF + , { "short": false, - "title": "Hostname", - "value": "${HOSTNAME}" - }, + "title": "Is my Game Server Online?", + "value": "" + } +EOF + ) +fi + +if [ -n "${alerturl}" ]; then + json+=$( + cat << EOF + , { "short": false, "title": "More info", "value": "${alerturl}" - }, - { - "short": false, - "title": "Server Time", - "value": "$(date)" } - ] - } - ] -} EOF -) + ) +fi -jsonnoinfo=$( +json+=$( cat << EOF -{ - "alias": "LinuxGSM", - "text": "*${alerttitle}*", - "attachments": [ - { - "title": "", - "color": "${alertcolourhex}", - "author_name": "LinuxGSM Alert", - "author_link": "https://linuxgsm.com", - "author_icon": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "thumb_url": "${alerticon}", - "text": "", - "fields": [ - { - "short": false, - "title": "Server Name", - "value": "${servername}" - }, - { - "short": false, - "title": "Information", - "value": "${alertmessage}" - }, - { - "short": false, - "title": "Game", - "value": "${gamename}" - }, - { - "short": false, - "title": "Server IP", - "value": "${alertip}:${port}" - }, - { - "short": false, - "title": "Hostname", - "value": "${HOSTNAME}" - }, + , { "short": false, "title": "Server Time", @@ -116,12 +86,6 @@ jsonnoinfo=$( EOF ) -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" -fi - fn_print_dots "Sending Rocketchat alert" rocketchatsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${rocketchatwebhook}") diff --git a/lgsm/modules/alert_slack.sh b/lgsm/modules/alert_slack.sh old mode 100644 new mode 100755 index 58dc54772..0cd7106ff --- a/lgsm/modules/alert_slack.sh +++ b/lgsm/modules/alert_slack.sh @@ -7,7 +7,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsonnoinfo=$( +json=$( cat << EOF { "attachments": [ @@ -50,10 +50,6 @@ jsonnoinfo=$( "type": "mrkdwn", "text": "*Server IP*\n\`${alertip}:${port}\`" }, - { - "type": "mrkdwn", - "text": "*Hostname*\n${HOSTNAME}" - }, { "type": "mrkdwn", "text": "*Server Time*\n$(date)" @@ -62,96 +58,45 @@ jsonnoinfo=$( "accessory": { "type": "image", "image_url": "${alerticon}", - "alt_text": "cute cat" + "alt_text": "LinuxGSM game icon" } - }, - { - "type": "context", - "elements": [ - { - "type": "image", - "image_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "alt_text": "LinuxGSM icon" - }, - { - "type": "plain_text", - "text": "Sent by LinuxGSM ${version}", - "emoji": true - } - ] } - ] - } - ] -} EOF ) -jsoninfo=$( - cat << EOF -{ - "attachments": [ - { - "color": "${alertcolourhex}", - "blocks": [ - { - "type": "header", - "text": { - "type": "mrkdwn", - "text": "${alerttitle}", - "emoji": true - } - }, - { - "type": "divider" - }, +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF + , { "type": "section", "text": { "type": "mrkdwn", - "text": "*Server Name*\n${servername}" + "text": "*Is my Game Server Online?*\n" } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Information*\n${alertmessage}" - } - }, - { - "type": "section", - "fields": [ - { - "type": "mrkdwn", - "text": "*Game*\n${gamename}" - }, - { - "type": "mrkdwn", - "text": "*Server IP*\n\`${alertip}:${port}\`" - }, - { - "type": "mrkdwn", - "text": "*Hostname*\n${HOSTNAME}" - }, - { - "type": "mrkdwn", - "text": "*Server Time*\n$(date)" - } - ], - "accessory": { - "type": "image", - "image_url": "${alerticon}", - "alt_text": "cute cat" - } - }, + } +EOF + ) +fi + +if [ -n "${alerturl}" ]; then + json+=$( + cat << EOF + , { "type": "section", "text": { "type": "mrkdwn", - "text": "*Server Time*\n${alertmessage}" + "text": "*More info*\n<${alerturl}|${alerturl}>" } - }, + } +EOF + ) +fi + +json+=$( + cat << EOF + , { "type": "context", "elements": [ @@ -174,12 +119,6 @@ jsoninfo=$( EOF ) -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" -fi - fn_print_dots "Sending Slack alert" slacksend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${slackwebhook}") diff --git a/lgsm/modules/alert_telegram.sh b/lgsm/modules/alert_telegram.sh old mode 100644 new mode 100755 index 2e719dba7..ace95d4db --- a/lgsm/modules/alert_telegram.sh +++ b/lgsm/modules/alert_telegram.sh @@ -7,40 +7,49 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsoninfo=$( +json=$( cat << EOF { "chat_id": "${telegramchatid}", "message_thread_id": "${telegramthreadid}", "parse_mode": "HTML", "disable_notification": "${telegramdisablenotification}", - "text": "${alerttitle}\n\nServer name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)", - "disable_web_page_preview": "yes" -} + "text": "${alerttitle}\n\nServer Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\n EOF ) -jsonnoinfo=$( +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF +Is my Game Server Online?\nCheck here\n\n +EOF + ) +fi + +if [ -n "${alerturl}" ]; then + json+=$( + cat << EOF +More info\n${alerturl}\n\n +EOF + ) +fi + +json+=$( cat << EOF -{ - "chat_id": "${telegramchatid}", - "message_thread_id": "${telegramthreadid}", - "parse_mode": "HTML", - "disable_notification": "${telegramdisablenotification}", - "text": "${alerttitle}\n\nServer name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)", +Server Time\n$(date)", "disable_web_page_preview": "yes" } EOF ) -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" +fn_print_dots "Sending Telegram alert" + +curlcustomargs=() +if [ -n "${curlcustomstring}" ]; then + read -r -a curlcustomargs <<< "${curlcustomstring}" fi -fn_print_dots "Sending Telegram alert" -telegramsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" ${curlcustomstring} "https://${telegramapi}/bot${telegramtoken}/sendMessage" | grep "error_code") +telegramsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${curlcustomargs[@]}" "https://${telegramapi}/bot${telegramtoken}/sendMessage" | grep "error_code") if [ -n "${telegramsend}" ]; then fn_print_fail_nl "Sending Telegram alert: ${telegramsend}" diff --git a/lgsm/modules/check.sh b/lgsm/modules/check.sh old mode 100644 new mode 100755 index 7601898a9..3922aec21 --- a/lgsm/modules/check.sh +++ b/lgsm/modules/check.sh @@ -31,7 +31,7 @@ if [ "${commandname}" != "INSTALL" ] && [ "${commandname}" != "UPDATE-LGSM" ] && check_system_dir.sh fi -allowed_commands_array=(START DEBUG) +allowed_commands_array=(DEBUG RESTART START) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_executable.sh @@ -39,7 +39,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do done if [ "$(whoami)" != "root" ]; then - allowed_commands_array=(DEBUG START INSTALL) + allowed_commands_array=(DEBUG RESTART START INSTALL) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_glibc.sh @@ -54,21 +54,21 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(BACKUP DEBUG START) +allowed_commands_array=(BACKUP DEBUG DETAILS RESTART START UPDATE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_deps.sh fi done -allowed_commands_array=(CONSOLE DEBUG MONITOR START STOP) +allowed_commands_array=(CONSOLE DEBUG MONITOR RESTART START STOP) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_config.sh fi done -allowed_commands_array=(DEBUG DETAILS DEV-QUERY-RAW MONITOR POST_DETAILS START STOP POST-DETAILS) +allowed_commands_array=(DEBUG DETAILS DEV-QUERY-RAW MONITOR POST_DETAILS RESTART START STOP POST-DETAILS) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then if [ -z "${installflag}" ]; then @@ -77,7 +77,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(DEBUG START UPDATE VALIDATE CHECK-UPDATE) +allowed_commands_array=(DEBUG RESTART START UPDATE VALIDATE CHECK-UPDATE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then if [ "${appid}" ]; then @@ -86,21 +86,21 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR START STOP UPDATE VALIDATE POST-DETAILS) +allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR RESTART START STOP UPDATE VALIDATE POST-DETAILS) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_status.sh fi done -allowed_commands_array=(DEBUG START INSTALL) +allowed_commands_array=(DEBUG RESTART START INSTALL) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_system_requirements.sh fi done -allowed_commands_array=(DETAILS MONITOR START STOP UPDATE VALIDATE POST-DETAILS) +allowed_commands_array=(DETAILS MONITOR RESTART START STOP UPDATE VALIDATE POST-DETAILS) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_gamedig.sh diff --git a/lgsm/modules/check_config.sh b/lgsm/modules/check_config.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh old mode 100644 new mode 100755 index d7df071d3..e4bcad4be --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -8,15 +8,28 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_dotnet_repo() { + local dotnetpackage + dotnetpackage="dotnet-runtime-7.0" + + for dep in "${array_deps_missing[@]}"; do + if [[ "${dep}" == dotnet-runtime-* ]]; then + dotnetpackage="${dep}" + break + fi + done + if [ "${distroid}" == "ubuntu" ]; then - # if package aspnetcore-runtime-7.0 is unavailable in ubuntu repos, add the microsoft repo. - if ! apt-cache show aspnetcore-runtime-7.0 > /dev/null 2>&1; then + # If the required .NET package is unavailable in Ubuntu repos, add the Microsoft repo. + if ! apt-cache show "${dotnetpackage}" > /dev/null 2>&1; then fn_fetch_file "https://packages.microsoft.com/config/ubuntu/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" "" sudo dpkg -i /tmp/packages-microsoft-prod.deb fi elif [ "${distroid}" == "debian" ]; then - fn_fetch_file "https://packages.microsoft.com/config/debian/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" "" - sudo dpkg -i /tmp/packages-microsoft-prod.deb + # If the required .NET package is unavailable in Debian repos, add the Microsoft repo. + if ! apt-cache show "${dotnetpackage}" > /dev/null 2>&1; then + fn_fetch_file "https://packages.microsoft.com/config/debian/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" "" + sudo dpkg -i /tmp/packages-microsoft-prod.deb + fi fi } @@ -75,14 +88,15 @@ fn_install_mono_repo() { # Run the mono repo install. eval "${cmd}" + monorepoexitcode=$? # Did Mono repo install correctly? if [ "${monoautoinstall}" != "1" ]; then - if [ $? != 0 ]; then + if [ "${monorepoexitcode}" -ne 0 ]; then fn_print_failure_nl "Unable to install Mono repository." fn_script_log_fail "Unable to install Mono repository." else - fn_print_complete_nl "Installing Mono repository completed." + fn_print_success_nl "Installing Mono repository completed." fn_script_log_pass "Installing Mono repository completed." fi fi @@ -113,13 +127,13 @@ fn_deps_email() { elif [ -d /etc/sendmail ]; then array_deps_required+=(sendmail) elif [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then - array_deps_required+=(mailx postfix) + array_deps_required+=(s-nail postfix) elif [ "$(command -v apt 2> /dev/null)" ]; then array_deps_required+=(mailutils postfix) fi else if [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then - array_deps_required+=(mailx postfix) + array_deps_required+=(s-nail postfix) elif [ "$(command -v apt 2> /dev/null)" ]; then array_deps_required+=(mailutils postfix) fi @@ -226,15 +240,15 @@ fn_install_missing_deps() { else if [ "${commandname}" == "INSTALL" ]; then - fn_print_information_nl "Required dependencies already installed." + fn_print_skip2_nl "Required dependencies already installed." fn_script_log_info "Required dependencies already installed." fi fi } fn_check_loop() { - # Loop though required depenencies checking if they are installed. - for deptocheck in ${array_deps_required[*]}; do + # Loop though required dependencies checking if they are installed. + for deptocheck in "${array_deps_required[@]}"; do fn_deps_detector done @@ -250,12 +264,15 @@ fn_deps_detector() { if [ "${deptocheck}" == "libsdl2-2.0-0:i386" ] && [ -z "${appid}" ]; then array_deps_required=("${array_deps_required[@]/libsdl2-2.0-0:i386/}") steamcmdstatus=1 + return elif [ "${deptocheck}" == "steamcmd" ] && [ -z "${appid}" ]; then array_deps_required=("${array_deps_required[@]/steamcmd/}") steamcmdstatus=1 + return elif [ "${deptocheck}" == "steamcmd" ] && [ "${distroid}" == "debian" ] && ! grep -qE '[^deb]+non-free([^-]|$)' /etc/apt/sources.list; then array_deps_required=("${array_deps_required[@]/steamcmd/}") steamcmdstatus=1 + return # Java: Added for users using Oracle JRE to bypass check. elif [[ ${deptocheck} == "openjdk"* ]] || [[ ${deptocheck} == "java"* ]]; then # Is java already installed? @@ -277,10 +294,10 @@ fn_deps_detector() { depstatus=1 monoinstalled=false fi - # .NET Core: A .NET Core repo needs to be installed. - elif [ "${deptocheck}" == "aspnetcore-runtime-7.0" ]; then - # .NET is not installed. - if [ -n "${dotnetversion}" ]; then + # .NET runtime: check installed runtime version for any dotnet-runtime-X.Y package. + elif [[ "${deptocheck}" =~ ^dotnet-runtime-([0-9]+\.[0-9]+)$ ]]; then + dotnetrequired="${BASH_REMATCH[1]}" + if [ "$(command -v dotnet 2> /dev/null)" ] && dotnet --list-runtimes | grep -q "Microsoft.NETCore.App ${dotnetrequired}"; then depstatus=0 dotnetinstalled=true else @@ -318,7 +335,7 @@ fn_deps_detector() { fi # If SteamCMD requirements are not met install will fail. if [ -n "${appid}" ]; then - for steamcmddeptocheck in ${array_deps_required_steamcmd[*]}; do + for steamcmddeptocheck in "${array_deps_required_steamcmd[@]}"; do if [ "${deptocheck}" != "steamcmd" ] && [ "${deptocheck}" == "${steamcmddeptocheck}" ]; then steamcmdfail=1 fi @@ -347,6 +364,8 @@ if [ "${commandname}" == "INSTALL" ]; then fi fi +info_distro.sh + # Will warn user if their distro is no longer supported by the vendor. if [ -n "${distrosupport}" ]; then if [ "${distrosupport}" == "unsupported" ]; then @@ -355,7 +374,32 @@ if [ -n "${distrosupport}" ]; then fi fi -info_distro.sh +# These titles are only supported up to Ubuntu 22.04 (Jammy) and Debian 12 (Bookworm). +if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "22.04"; } || { [ "${distroid}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "12"; }; then + if [ "${shortname}" == "bf1942" ] || [ "${shortname}" == "bfv" ]; then + fn_print_failure_nl "${gamename} is not supported on ${distroname} (requires Ubuntu <= 22.04 or Debian <= 12)." + fn_script_log_fail "${gamename} is not supported on ${distroname}." + core_exit.sh + fi +fi + +# These titles are only supported up to Ubuntu 20.04 and Debian 11. +if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "20.04"; } || { [ "${distroid}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "11"; }; then + if [ "${shortname}" == "onset" ] || [ "${shortname}" == "btl" ]; then + fn_print_failure_nl "${gamename} is not supported on ${distroname} (requires Ubuntu <= 20.04 or Debian <= 11)." + fn_script_log_fail "${gamename} is not supported on ${distroname}." + core_exit.sh + fi +fi + +# Vintage Story tracks newer .NET runtimes; older distro releases may not ship required packages. +if [ "${shortname}" == "vints" ]; then + if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "lt" "24.04"; } || { [ "${distroid}" == "debian" ] && dpkg --compare-versions "${distroversion}" "lt" "12"; } || [ "${distroid}" == "centos" ] || [ "${distroid}" == "rhel" ] || [ "${distroid}" == "rocky" ] || [ "${distroid}" == "almalinux" ]; then + fn_print_warning_nl "${gamename} may require newer .NET runtimes than ${distroname} provides." + echo -e "If startup fails due to missing .NET runtime, upgrading to Ubuntu 24.04+ or Debian 12+ is recommended." + fn_script_log_warn "${gamename} may require newer .NET runtimes than ${distroname} provides." + fi +fi if [ ! -f "${tmpdir}/dependency-no-check.tmp" ] && [ ! -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then # Check that the distro dependency csv file exists. diff --git a/lgsm/modules/check_executable.sh b/lgsm/modules/check_executable.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_gamedig.sh b/lgsm/modules/check_gamedig.sh old mode 100644 new mode 100755 index 70aeea41b..0942ac42a --- a/lgsm/modules/check_gamedig.sh +++ b/lgsm/modules/check_gamedig.sh @@ -5,6 +5,8 @@ # Website: https://linuxgsm.com # Description: Installs nodejs and gamedig +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + if [ "$(command -v node)" ] && [ "$(command -v npm)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)" -ge 16 ] && [ ! -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ]; then echo -e "" echo -e "${bold}${lightyellow}Installing Gamedig${default}" diff --git a/lgsm/modules/check_glibc.sh b/lgsm/modules/check_glibc.sh old mode 100644 new mode 100755 index 8b3d00658..e49b461f6 --- a/lgsm/modules/check_glibc.sh +++ b/lgsm/modules/check_glibc.sh @@ -17,7 +17,7 @@ elif [ -z "${glibc}" ]; then fn_print_error_nl "Checking glibc: requirement unknown" fn_script_log_error "Checking glibc: requirement unknown" fn_sleep_time_5 -elif [ "$(printf '%s\n'${glibc}'\n' "${glibcversion}" | sort -V | head -n 1)" != "${glibc}" ]; then +elif [ "$(printf '%s\n' "${glibc}" "${glibcversion}" | sort -V | head -n 1)" != "${glibc}" ]; then fn_print_dots "Checking glibc" fn_print_error_nl "Checking glibc: requirements not met" fn_script_log_error "Checking glibc: requirements not met" diff --git a/lgsm/modules/check_ip.sh b/lgsm/modules/check_ip.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_last_update.sh b/lgsm/modules/check_last_update.sh old mode 100644 new mode 100755 index 2686c6507..a68285344 --- a/lgsm/modules/check_last_update.sh +++ b/lgsm/modules/check_last_update.sh @@ -11,6 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ -f "${lockdir}/${selfname}-last-started.lock" ]; then laststart=$(cat "${lockdir}/${selfname}-last-started.lock") fi + if [ -f "${lockdir}/last-updated.lock" ]; then lastupdate=$(cat "${lockdir}/last-updated.lock") fi diff --git a/lgsm/modules/check_logs.sh b/lgsm/modules/check_logs.sh old mode 100644 new mode 100755 index 5e2d66c35..36fb24036 --- a/lgsm/modules/check_logs.sh +++ b/lgsm/modules/check_logs.sh @@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_check_logs() { fn_print_dots "Checking for log files" fn_print_info_nl "Checking for log files: Creating log files" - checklogs=1 + checklogs=true install_logs.sh } diff --git a/lgsm/modules/check_permissions.sh b/lgsm/modules/check_permissions.sh old mode 100644 new mode 100755 index 9ed1bb65e..73fba983d --- a/lgsm/modules/check_permissions.sh +++ b/lgsm/modules/check_permissions.sh @@ -63,8 +63,8 @@ fn_check_permissions() { findnotexecutable="$(find "${modulesdir}" -type f -not -executable)" findnotexecutablewc="$(find "${modulesdir}" -type f -not -executable | wc -l)" if [ "${findnotexecutablewc}" -ne "0" ]; then - fn_print_fail_nl "Permissions issues found" - fn_script_log_fail "Permissions issues found" + fn_print_error_nl "Permissions issues found" + fn_script_log_error "Permissions issues found" fn_print_information_nl "The following files are not executable:" fn_script_log_info "The following files are not executable:" { @@ -249,7 +249,7 @@ fn_sys_perm_error_process() { fi } -## Run permisions checks when not root. +## Run permissions checks when not root. if [ "$(whoami)" != "root" ]; then fn_check_ownership fn_check_permissions diff --git a/lgsm/modules/check_root.sh b/lgsm/modules/check_root.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_status.sh b/lgsm/modules/check_status.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_steamcmd.sh b/lgsm/modules/check_steamcmd.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_system_dir.sh b/lgsm/modules/check_system_dir.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_system_requirements.sh b/lgsm/modules/check_system_requirements.sh old mode 100644 new mode 100755 index 7dd0551a5..f34190fec --- a/lgsm/modules/check_system_requirements.sh +++ b/lgsm/modules/check_system_requirements.sh @@ -39,7 +39,7 @@ elif [ "${shortname}" == "mh" ]; then ramrequirementgb="4" elif [ "${shortname}" == "ns2" ] || [ "${shortname}" == "ns2c" ]; then ramrequirementgb="1" -elif [ "${shortname}" == "ps" ]; then +elif [ "${shortname}" == "squad44" ]; then ramrequirementgb="2" elif [ "${shortname}" == "pvr" ]; then ramrequirementgb="1" @@ -71,8 +71,9 @@ fi if [ "${ramrequirementgb}" ]; then if (($(echo "${physmemtotalgb} < ${ramrequirementgb}" | bc -l))); then fn_print_dots "Checking RAM" - fn_print_warn_nl "Checking RAM: ${ramrequirementgb}G required, ${physmemtotal} available" - echo "* ${gamename} server may fail to run or experience poor performance." + fn_print_warn_nl "Checking RAM: Minimum RAM requirements not met" + fn_print_nl "* ${ramrequirementgb}G is required, but only ${physmemtotal} is available." + fn_print_nl "* ${gamename} server may fail to run or experience poor performance." fn_sleep_time_5 fi fi diff --git a/lgsm/modules/check_tmuxception.sh b/lgsm/modules/check_tmuxception.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_version.sh b/lgsm/modules/check_version.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_backup.sh b/lgsm/modules/command_backup.sh old mode 100644 new mode 100755 index 6bbc07f02..5892a81eb --- a/lgsm/modules/command_backup.sh +++ b/lgsm/modules/command_backup.sh @@ -6,20 +6,20 @@ # Description: Creates a .tar.gz file in the backup directory. commandname="BACKUP" -commandaction="Backing up" +commandaction="Backup" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set # Trap to remove lockfile on quit. fn_backup_trap() { echo -e "" - echo -en "backup ${backupname}.tar.gz..." + echo -en "backup ${backupname}.${compressext}..." fn_print_canceled_eol_nl - fn_script_log_info "Backup ${backupname}.tar.gz: CANCELED" - rm -f "${backupdir:?}/${backupname}.tar.gz" | tee -a "${lgsmlog}" - echo -en "backup ${backupname}.tar.gz..." + fn_script_log_info "Backup ${backupname}.${compressext}: CANCELED" + rm -f "${backupdir:?}/${backupname}.${compressext}" | tee -a "${lgsmlog}" + echo -en "backup ${backupname}.${compressext}..." fn_print_removed_eol_nl - fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED" + fn_script_log_info "Backup ${backupname}.${compressext}: REMOVED" # Remove backup lockfile. rm -f "${lockdir:?}/backup.lock" fn_backup_start_server @@ -110,25 +110,49 @@ fn_backup_create_lockfile() { trap fn_backup_trap INT } +fn_select_compression() { + if command -v zstd > /dev/null 2>&1; then + compressprog="zstd" + compressext="tar.zst" + compressflag="--zstd" + elif command -v pigz > /dev/null 2>&1; then + compressprog="pigz" + compressext="tar.gz" + compressflag="--use-compress-program=pigz" + elif command -v gzip > /dev/null 2>&1; then + compressprog="gzip" + compressext="tar.gz" + compressflag="--gzip" + else + compressprog="" + compressext="tar" + compressflag="" + fi +} + # Compressing files. fn_backup_compression() { - # Tells how much will be compressed using rootdirduexbackup value from info_distro and prompt for continue. + fn_print_info "A total of ${rootdirduexbackup} will be compressed." - fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.tar.gz" - fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress..." - fn_script_log_info "Backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress" + fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.${compressext}" + fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.${compressext}, in progress ..." + fn_script_log_info "Backup ${rootdirduexbackup} ${backupname}.${compressext}, in progress" excludedir=$(fn_backup_relpath) - # Check that excludedir is a valid path. if [ ! -d "${excludedir}" ]; then fn_print_fail_nl "Problem identifying the previous backup directory for exclusion." fn_script_log_fail "Problem identifying the previous backup directory for exclusion" core_exit.sh fi - tar --use-compress-program=pigz -cf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./. - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ -n "${compressflag}" ]; then + tar ${compressflag} -hcf "${backupdir}/${backupname}.${compressext}" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./. + else + tar -hcf "${backupdir}/${backupname}.${compressext}" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./. + fi + + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol fn_script_log_fail "Backup in progress: FAIL" echo -e "${extractcmd}" | tee -a "${lgsmlog}" @@ -136,8 +160,8 @@ fn_backup_compression() { fn_script_log_fail "Starting backup" else fn_print_ok_eol - fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" - fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" + fn_print_ok "Completed: ${italic}${backupname}.${compressext}${default}, total size $(du -sh "${backupdir}/${backupname}.${compressext}" | awk '{print $1}')" + fn_script_log_pass "Backup created: ${backupname}.${compressext}, total size $(du -sh "${backupdir}/${backupname}.${compressext}" | awk '{print $1}')" alert="backup" alert.sh fi @@ -152,7 +176,7 @@ fn_backup_prune() { # How many backups exceed maxbackups. backupquotadiff=$((backupcount - maxbackups)) # How many backups exceed maxbackupdays. - backupsoudatedcount=$(find "${backupdir}"/ -type f -name "*.tar.gz" -mtime +"${maxbackupdays}" | wc -l) + backupsoudatedcount=$(find "${backupdir}"/ -type f -name "*.tar.*" -mtime +"${maxbackupdays}" | wc -l) # If anything can be cleared. if [ "${backupquotadiff}" -gt "0" ] || [ "${backupsoudatedcount}" -gt "0" ]; then fn_print_dots "Pruning" @@ -167,7 +191,7 @@ fn_backup_prune() { fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" # Clear backups over quota. - find "${backupdir}"/ -type f -name "*.tar.gz" -printf '%T@ %p\n' | sort -rn | tail -${backupquotadiff} | cut -f2- -d" " | xargs rm + find "${backupdir}"/ -type f -name "*.tar.*" -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. @@ -190,7 +214,7 @@ fn_backup_prune() { fn_backup_relpath() { # Written by CedarLUG as a "realpath --relative-to" alternative in bash. # Populate an array of tokens initialized from the rootdir components. - declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) + mapfile -t rdirtoks < <(readlink -f "${rootdir}" | sed "s/\//\n/g") if [ ${#rdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing rootdir during relative path assessment" fn_script_log_fail "Problem assessing rootdir during relative path assessment: ${rootdir}" @@ -198,7 +222,7 @@ fn_backup_relpath() { fi # Populate an array of tokens initialized from the backupdir components. - declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) + mapfile -t bdirtoks < <(readlink -f "${backupdir}" | sed "s/\//\n/g") if [ ${#bdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing backupdir during relative path assessment" fn_script_log_fail "Problem assessing backupdir during relative path assessment: ${rootdir}" @@ -243,12 +267,12 @@ fn_backup_start_server() { fn_print_dots "" check.sh core_logs.sh - +fn_select_compression fn_backup_check_lockfile +fn_backup_create_lockfile fn_backup_init fn_backup_stop_server fn_backup_dir -fn_backup_create_lockfile fn_backup_compression fn_backup_prune fn_backup_start_server diff --git a/lgsm/modules/command_check_update.sh b/lgsm/modules/command_check_update.sh old mode 100644 new mode 100755 index ee4c8ccb3..93a770e79 --- a/lgsm/modules/command_check_update.sh +++ b/lgsm/modules/command_check_update.sh @@ -30,8 +30,14 @@ elif [ "${shortname}" == "jk2" ]; then update_jk2.sh elif [ "${shortname}" == "vints" ]; then update_vints.sh +elif [ "${shortname}" == "bb" ]; then + update_bb.sh elif [ "${shortname}" == "ut99" ]; then update_ut99.sh +elif [ "${shortname}" == "xnt" ]; then + update_xnt.sh +elif [ "${shortname}" == "etl" ]; then + update_etl.sh else update_steamcmd.sh fi diff --git a/lgsm/modules/command_console.sh b/lgsm/modules/command_console.sh old mode 100644 new mode 100755 index aa17e839e..6344088b3 --- a/lgsm/modules/command_console.sh +++ b/lgsm/modules/command_console.sh @@ -6,13 +6,14 @@ # Description: Gives access to the server tmux console. commandname="CONSOLE" -commandaction="Access console" +commandaction="Access Console" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -check.sh fn_print_header +check.sh + if [ "${consoleverbose}" == "yes" ]; then echo -e "* Verbose output: ${lightgreen}yes${default}" elif [ "${consoleverbose}" == "no" ]; then @@ -29,10 +30,10 @@ else echo -e "* Interactive output: ${red}unknown${default}" fi echo "" -fn_print_information_nl "Press \"CTRL+b\" then \"d\" to exit console." -fn_print_warning_nl "Do NOT press CTRL+c to exit." -echo -e "* https://docs.linuxgsm.com/commands/console" +fn_print_information_nl "Press ${italic}\"CTRL+b\"${default} then ${italic}\"d\"${default} to exit console." +fn_print_warning_nl "Do ${underline}NOT${default} press CTRL+c to exit." echo -e "" +echo -e "${italic}https://docs.linuxgsm.com/commands/console${default}" if ! fn_prompt_yn "Continue?" Y; then exitcode=0 core_exit.sh diff --git a/lgsm/modules/command_debug.sh b/lgsm/modules/command_debug.sh old mode 100644 new mode 100755 index b5f2dabac..e502605f2 --- a/lgsm/modules/command_debug.sh +++ b/lgsm/modules/command_debug.sh @@ -6,7 +6,7 @@ # Description: Runs the server without tmux and directly from the terminal. commandname="DEBUG" -commandaction="Debuging" +commandaction="Debugging" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set @@ -24,11 +24,13 @@ fn_lockfile_trap() { core_exit.sh } +fn_print_header + check.sh fix.sh info_distro.sh info_game.sh -fn_print_header + { echo -e "${lightblue}Distro:\t\t${default}${distroname}" echo -e "${lightblue}Architecture:\t\t${default}${arch}" @@ -47,7 +49,7 @@ if [ -n "${glibc}" ]; then : elif [ -z "${glibc}" ]; then echo -e "${lightblue}glibc required:\t${red}UNKNOWN${default}" - elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then + elif [ "$(printf '%s\n' "${glibc}" "${glibcversion}" | sort -V | head -n 1)" != "${glibc}" ]; then echo -e "${lightblue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})" else echo -e "${lightblue}glibc required:\t${green}${glibc}${default}" @@ -121,9 +123,10 @@ else eval "${preexecutable} ${executable} ${startparameters}" fi -if [ $? -ne 0 ]; then - fn_print_error_nl "Server has stopped: exit code: $?" - fn_script_log_error "Server has stopped: exit code: $?" +exitcode=$? +if [ "${exitcode}" -ne 0 ]; then + fn_print_error_nl "Server has stopped: exit code: ${exitcode}" + fn_script_log_error "Server has stopped: exit code: ${exitcode}" fn_print_error_nl "Press ENTER to exit debug mode" read -r else diff --git a/lgsm/modules/command_details.sh b/lgsm/modules/command_details.sh old mode 100644 new mode 100755 index 2800e5123..047f50c6f --- a/lgsm/modules/command_details.sh +++ b/lgsm/modules/command_details.sh @@ -6,7 +6,7 @@ # Description: Displays server information. commandname="DETAILS" -commandaction="Viewing details" +commandaction="Display Details" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set @@ -29,7 +29,7 @@ fn_info_messages_gameserver_resource fn_info_messages_gameserver fn_info_messages_script fn_info_messages_backup -# Some game servers do not have parms. +# Some game servers do not have params. if [ "${shortname}" != "jc2" ] && [ "${shortname}" != "dst" ] && [ "${shortname}" != "pz" ] && [ "${engine}" != "renderware" ]; then fn_info_messages_commandlineparms fi diff --git a/lgsm/modules/command_dev_clear_modules.sh b/lgsm/modules/command_dev_clear_modules.sh old mode 100644 new mode 100755 index e2e80164f..d6196ba74 --- a/lgsm/modules/command_dev_clear_modules.sh +++ b/lgsm/modules/command_dev_clear_modules.sh @@ -6,7 +6,7 @@ # Description: Deletes the contents of the modules dir. commandname="DEV-CLEAR-MODULES" -commandaction="Clearing modules" +commandaction="Clear Modules" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set diff --git a/lgsm/modules/command_dev_debug.sh b/lgsm/modules/command_dev_debug.sh old mode 100644 new mode 100755 index 3226fc186..2b13b8c41 --- a/lgsm/modules/command_dev_debug.sh +++ b/lgsm/modules/command_dev_debug.sh @@ -6,7 +6,7 @@ # Description: Dev only: Enables debugging log to be saved to dev-debug.log. commandname="DEV-DEBUG" -commandaction="Developer debug" +commandaction="Developer Debug" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_reset diff --git a/lgsm/modules/command_dev_detect_deps.sh b/lgsm/modules/command_dev_detect_deps.sh old mode 100644 new mode 100755 index fead2c285..fca15f075 --- a/lgsm/modules/command_dev_detect_deps.sh +++ b/lgsm/modules/command_dev_detect_deps.sh @@ -6,13 +6,11 @@ # Description: Detects dependencies the server binary requires. commandname="DEV-DETECT-DEPS" -commandaction="Developer detect deps" +commandaction="Dependency Checker" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -echo -e "" -echo -e "${bold}Dependencies Checker${default}" -fn_messages_separator +fn_print_header echo -e "Checking directory: " echo -e "${serverfiles}" if [ "$(command -v eu-readelf 2> /dev/null)" ]; then @@ -186,7 +184,7 @@ echo -e "${bold}Required Dependencies${default}" fn_messages_separator echo -e "${executable}" echo -e "" -echo -e "CentOS" +echo -e "${bold}CentOS" fn_messages_separator cat "${tmpdir}/.depdetect_centos_line" echo -e "" diff --git a/lgsm/modules/command_dev_detect_glibc.sh b/lgsm/modules/command_dev_detect_glibc.sh old mode 100644 new mode 100755 index 6326cf5cb..5af93466b --- a/lgsm/modules/command_dev_detect_glibc.sh +++ b/lgsm/modules/command_dev_detect_glibc.sh @@ -7,13 +7,11 @@ # Can check a file or directory recursively. commandname="DEV-DETECT-GLIBC" -commandaction="Developer detect glibc" +commandaction="Detect Glibc Requirements" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -fn_messages_separator -echo -e "glibc Requirements Checker" -fn_messages_separator +fn_print_header if [ ! "$(command -v objdump 2> /dev/null)" ]; then fn_print_failure_nl "objdump is missing" @@ -48,24 +46,24 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do 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) + glibcversion=$(objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" | grep -v GLIBCXX | sort | uniq | sort -r --version-sort | head -n 1 | sed 's/)$//') if [ "${glibcversion}" ]; then echo -e "${glibcversion}: ${line}" >> "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" fi - objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" >> "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" + objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" | sed 's/)$//' >> "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" echo -n "${i} / ${glibc_check_files}" $'\r' ((i++)) done echo -e "" echo -e "" - echo -e "${glibc_check_name} glibc Requirements" + fn_print_nl "${bold}${lightyellow}${glibc_check_name} glibc Requirements" fn_messages_separator if [ -f "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" ]; then echo -e "Required glibc" cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort | head -1 | tee -a "${tmpdir}/detect_glibc_highest.tmp" echo -e "" echo -e "Files requiring GLIBC" - echo -e "Highest verion required: filename" + echo -e "Highest version required: filename" cat "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" echo -e "" echo -e "All required GLIBC versions" @@ -80,7 +78,7 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do fi done echo -e "" -echo -e "Final glibc Requirement" +fn_print_nl "${bold}${lightyellow}Final glibc Requirement" fn_messages_separator if [ -f "${tmpdir}/detect_glibc_highest.tmp" ]; then cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1 diff --git a/lgsm/modules/command_dev_detect_ldd.sh b/lgsm/modules/command_dev_detect_ldd.sh old mode 100644 new mode 100755 index 9d0bf5148..62db24da0 --- a/lgsm/modules/command_dev_detect_ldd.sh +++ b/lgsm/modules/command_dev_detect_ldd.sh @@ -7,13 +7,11 @@ # Can check a file or directory recursively. commandname="DEV-DETECT-LDD" -commandaction="Developer detect ldd" +commandaction="Shared Object Dependencies Checker" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -fn_messages_separator -echo -e "Shared Object dependencies Checker" -fn_messages_separator +fn_print_header if [ -z "${serverfiles}" ]; then dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") @@ -46,12 +44,12 @@ find "${serverfiles}" -type f -print0 \ done echo -e "" echo -e "" -echo -e "All" +fn_print_nl "${bold}${lightyellow}All${default}" fn_messages_separator cat "${tmpdir}/detect_ldd.tmp" echo -e "" -echo -e "Not Found" +fn_print_nl "${bold}${lightyellow}Not Found${default}" fn_messages_separator cat "${tmpdir}/detect_ldd_not_found.tmp" diff --git a/lgsm/modules/command_dev_parse_distro_details.sh b/lgsm/modules/command_dev_parse_distro_details.sh old mode 100644 new mode 100755 index f80c909ad..dfb68ba2b --- a/lgsm/modules/command_dev_parse_distro_details.sh +++ b/lgsm/modules/command_dev_parse_distro_details.sh @@ -5,6 +5,13 @@ # Website: https://linuxgsm.com # Description: Display parsed distro details. +commandname="DEV-PARSE-DISTRO-DETAILS" +commandaction="Parse Distro Details" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_header + check_ip.sh check_status.sh info_distro.sh diff --git a/lgsm/modules/command_dev_parse_game_details.sh b/lgsm/modules/command_dev_parse_game_details.sh old mode 100644 new mode 100755 index 87284904c..893785ff3 --- a/lgsm/modules/command_dev_parse_game_details.sh +++ b/lgsm/modules/command_dev_parse_game_details.sh @@ -5,6 +5,13 @@ # Website: https://linuxgsm.com # Description: Display parsed gameserver details. +commandname="DEV-PARSE-GAME-DETAILS" +commandaction="Parse Game Details" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_header + if [ -f "config" ]; then servercfgfullpath="config" fi @@ -89,6 +96,7 @@ declare -A server_details=( ['RCON Port']="${rconport}" ['RCON Web']="${rconweb}" ['Reserved Slots']="${reservedslots}" + ['Reliable Messaging']="${reliableport}" ['RMI Port']="${rmiport}" ['RMI Reg Port']="${rmiregport}" ['Salt']="${salt}" diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh old mode 100644 new mode 100755 index 345298941..61b4d7a70 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -6,10 +6,12 @@ # Description: Raw gamedig output of the server. commandname="DEV-QUERY-RAW" -commandaction="Developer query raw" +commandaction="Developer Query Raw" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set +fn_print_header + check.sh info_game.sh info_distro.sh @@ -26,24 +28,24 @@ echo -e "Telnet IP: ${telnetip}" echo -e "Display IP: ${displayip}" echo -e "" -echo -e "${lightgreen}Query IP Addresses${default}" +echo -e "${bold}${lightyellow}Query IP Addresses${default}" fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do echo -e "${queryip}" done echo -e "" -echo -e "${lightgreen}Game Server Ports${default}" +echo -e "${bold}${lightyellow}Game Server Ports${default}" fn_messages_separator { echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}" - if [ -v port ]; then + if [ -n "${port}" ]; then echo -e "Game: \t${port} \t$(ss -tupl | grep -c "${port}") \t$(ss -tupl | grep "${port}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port}" | grep udp | awk '{ print $2 }')" else echo -e "Game:" fi if [ "${shortname}" == "pvr" ]; then - if [ -v port401 ]; then + if [ -n "${port401}" ]; then echo -e "Game+400: \t${port401} \t$(ss -tupl | grep -c "${port401}") \t$(ss -tupl | grep "${port401}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port401}" | grep udp | awk '{ print $2 }')" else echo -e "Game+400:" @@ -51,140 +53,146 @@ fn_messages_separator fi if [ "${shortname}" == "mcb" ]; then - if [ -v portipv6 ]; then + if [ -n "${portipv6}" ]; then echo -e "Game ipv6: \t${portipv6} \t$(ss -tupl | grep -c "${portipv6}") \t$(ss -tupl | grep "${portipv6}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${portipv6}" | grep udp | awk '{ print $2 }')" else echo -e "Game ipv6:" fi fi - if [ -v queryport ]; then + if [ -n "${queryport}" ]; then echo -e "Query: \t${queryport} \t$(ss -tupl | grep -c "${queryport}") \t$(ss -tupl | grep "${queryport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${queryport}" | grep udp | awk '{ print $2 }')" else echo -e "Query:" fi - if [ -v apiport ]; then + if [ -n "${apiport}" ]; then echo -e "Game: \t${apiport} \t$(ss -tupl | grep -c "${apiport}") \t$(ss -tupl | grep "${apiport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${apiport}" | grep udp | awk '{ print $2 }')" else echo -e "API:" fi - if [ -v appport ]; then + if [ -n "${appport}" ]; then echo -e "App: \t${appport} \t$(ss -tupl | grep -c "${appport}") \t$(ss -tupl | grep "${appport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${appport}" | grep udp | awk '{ print $2 }')" else echo -e "App:" fi - if [ -v battleeyeport ]; then + if [ -n "${battleeyeport}" ]; then echo -e "BattleEye: \t${battleeyeport} \t$(ss -tupl | grep -c "${battleeyeport}") \t$(ss -tupl | grep "${battleeyeport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${battleeyeport}" | grep udp | awk '{ print $2 }')" else echo -e "BattleEye:" fi - if [ -v beaconport ]; then + if [ -n "${beaconport}" ]; then echo -e "Beacon: \t${beaconport} \t$(ss -tupl | grep -c "${beaconport}") \t$(ss -tupl | grep "${beaconport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${beaconport}" | grep udp | awk '{ print $2 }')" else echo -e "Beacon:" fi - if [ -v clientport ]; then + if [ -n "${reliableport}" ]; then + echo -e "ReliableMessaging: \t${reliableport} \t$(ss -tupl | grep -c "${reliableport}") \t$(ss -tupl | grep "${reliableport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${reliableport}" | grep udp | awk '{ print $2 }')" + else + echo -e "ReliableMessaging:" + fi + + if [ -n "${clientport}" ]; then echo -e "Client: \t${clientport} \t$(ss -tupl | grep -c "${clientport}") \t$(ss -tupl | grep "${clientport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${clientport}" | grep udp | awk '{ print $2 }')" else echo -e "Client:" fi - if [ -v fileport ]; then + if [ -n "${fileport}" ]; then echo -e "File: \t${fileport} \t$(ss -tupl | grep -c "${fileport}") \t$(ss -tupl | grep "${fileport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${fileport}" | grep udp | awk '{ print $2 }')" else echo -e "File:" fi - if [ -v httpport ]; then + if [ -n "${httpport}" ]; then echo -e "HTTP: \t${httpport} \t$(ss -tupl | grep -c "${httpport}") \t$(ss -tupl | grep "${httpport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${httpport}" | grep udp | awk '{ print $2 }')" else echo -e "HTTP:" fi - if [ -v httpqueryport ]; then + if [ -n "${httpqueryport}" ]; then echo -e "HTTP Query: \t${httpqueryport} \t$(ss -tupl | grep -c "${httpqueryport}") \t$(ss -tupl | grep" ${httpqueryport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${httpqueryport}" | grep udp | awk '{ print $2 }')" else echo -e "HTTP Query:" fi - if [ -v httpport ]; then + if [ -n "${httpport}" ]; then echo -e "Web Interface: \t${httpport} \t$(ss -tupl | grep -c "${httpport}") \t$(ss -tupl | grep "${httpport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${httpport}" | grep udp | awk '{ print $2 }')" else echo -e "Web Interface:" fi - if [ -v masterport ]; then + if [ -n "${masterport}" ]; then echo -e "Game: Master: \t${masterport} \t$(ss -tupl | grep -c "${masterport}") \t$(ss -tupl | grep "${masterport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${masterport}" | grep udp | awk '{ print $2 }')" else echo -e "Game: Master:" fi - if [ -v rawport ]; then + if [ -n "${rawport}" ]; then echo -e "RAW UDP Socket: \t${rawport} \t$(ss -tupl | grep -c "${rawport}") \t$(ss -tupl | grep "${rawport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${rawport}" | grep udp | awk '{ print $2 }')" else echo -e "RAW UDP Socket:" fi - if [ -v rconport ]; then + if [ -n "${rconport}" ]; then echo -e "RCON: \t${rconport} \t$(ss -tupl | grep -c "${rconport}") \t$(ss -tupl | grep "${rconport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${rconport}" | grep udp | awk '{ print $2 }')" else echo -e "RCON:" fi - if [ -v steamport ]; then + if [ -n "${steamport}" ]; then echo -e "Steam: \t${steamport} \t$(ss -tupl | grep -c "${steamport}") \t$(ss -tupl | grep "${steamport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${steamport}" | grep udp | awk '{ print $2 }')" else echo -e "Steam:" fi - if [ -v steamworksport ]; then + if [ -n "${steamworksport}" ]; then echo -e "Steamworks P2P: \t${steamworksport} \t$(ss -tupl | grep -c "${steamworksport}") \t$(ss -tupl | grep "${steamworksport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${steamworksport}" | grep udp | awk '{ print $2 }')" else echo -e "Steamworks P2P:" fi - if [ -v steamauthport ]; then + if [ -n "${steamauthport}" ]; then echo -e "Steam: Auth: \t${steamauthport} \t$(ss -tupl | grep -c "${steamauthport}") \t$(ss -tupl | grep "${steamauthport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${steamauthport}" | grep udp | awk '{ print $2 }')" else echo -e "Steam: Auth:" fi - if [ -v telnetport ]; then + if [ -n "${telnetport}" ]; then echo -e "Telnet: \t${telnetport} \t$(ss -tupl | grep -c "${telnetport}") \t$(ss -tupl | grep "${telnetport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${telnetport}" | grep udp | awk '{ print $2 }')" else echo -e "Telnet:" fi - if [ -v statsport ]; then + if [ -n "${statsport}" ]; then echo -e "Stats: \t${battleeyeport} \t$(ss -tupl | grep -c "${statsport}") \t$(ss -tupl | grep "${statsport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${statsport}" | grep udp | awk '{ print $2 }')" else echo -e "Stats:" fi - if [ -v sourcetvport ]; then + if [ -n "${sourcetvport}" ]; then echo -e "SourceTV: \t${sourcetvport} \t$(ss -tupl | grep -c "${sourcetvport}") \t$(ss -tupl | grep "${sourcetvport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${sourcetvport}" | grep udp | awk '{ print $2 }')" else echo -e "SourceTV:" fi - if [ -v udplinkport ]; then + if [ -n "${udplinkport}" ]; then echo -e "UDP Link: \t${udplinkport} \t$(ss -tupl | grep -c "${udplinkport}") \t$(ss -tupl | grep "${udplinkport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${udplinkport}" | grep udp | awk '{ print $2 }')" else echo -e "UDP Link:" fi - if [ -v voiceport ]; then + if [ -n "${voiceport}" ]; then echo -e "Voice: \t${voiceport} \t$(ss -tupl | grep -c "${voiceport}") \t$(ss -tupl | grep "${voiceport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${voiceport}" | grep udp | awk '{ print $2 }')" else echo -e "Voice:" fi - if [ -v voiceunusedport ]; then + if [ -n "${voiceunusedport}" ]; then echo -e "Voice (Unused): \t${voiceunusedport} \t$(ss -tupl | grep -c "${voiceunusedport}") \t$(ss -tupl | grep "${voiceunusedport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${voiceunusedport}" | grep udp | awk '{ print $2 }')" else echo -e "Voice (Unused):" @@ -192,53 +200,58 @@ fn_messages_separator } \ | column -s $'\t' -t + echo -e "" -echo -e "${lightgreen}SS Output${default}" +echo -e "${bold}${lightyellow}SS Output${default}" fn_messages_separator fn_info_messages_ports eval "${portcommand}" + echo -e "" -echo -e "${lightgreen}Query Port - Raw Output${default}" +echo -e "${bold}${lightyellow}Query Port (${queryport}) - Gamedig Output${default}" fn_messages_separator echo -e "" echo -e "PORT: ${port}" echo -e "QUERY PORT: ${queryport}" echo -e "" +echo -e "${lightgreen}Is My Game Server Online?${default}" +fn_messages_separator +echo -e "Game server status: https://ismygameserver.online/${imgsoquerytype}/${queryip}:${queryport}" +echo -e "" echo -e "${lightgreen}Gamedig Raw Output${default}" fn_messages_separator echo -e "" if [ ! "$(command -v gamedig 2> /dev/null)" ] && [ ! -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ]; then fn_print_failure_nl "gamedig not installed" fi -if [ ! "$(command -v jq 2> /dev/null)" ]; then - fn_print_failure_nl "jq not installed" -fi for queryip in "${queryips[@]}"; do query_gamedig.sh - echo -e "${gamedigcmd}" + echo -e "${italic}${gamedigcmd}${default}" echo"" echo "${gamedigraw}" | jq done + echo -e "" -echo -e "${lightgreen}gsquery Raw Output${default}" +echo -e "${bold}${lightyellow}Query Port (${queryport}) - gsquery Output${default}" fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do - echo -e "./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\"" + echo -e "${italic}./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\"${default}" echo -e "" if [ ! -f "${modulesdir}/query_gsquery.py" ]; then fn_fetch_file_github "lgsm/modules" "query_gsquery.py" "${modulesdir}" "chmodx" "norun" "noforce" "nohash" fi "${modulesdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" done + echo -e "" -echo -e "${lightgreen}TCP Raw Output${default}" +echo -e "${bold}${lightyellow}Query Port (${queryport}) - TCP Output${default}" fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do - echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''" + echo -e "${italic}bash -c 'exec 3<> /dev/tcp/'\"${queryip}\"'/'\"${queryport}\"''${default}" echo -e "" - timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}'' + timeout 3 bash -c 'exec 3<> /dev/tcp/'"${queryip}"'/'"${queryport}"'' querystatus="$?" echo -e "" if [ "${querystatus}" == "0" ]; then @@ -248,16 +261,16 @@ for queryip in "${queryips[@]}"; do fi done echo -e "" -echo -e "${lightgreen}Game Port - Raw Output${default}" +echo -e "${bold}${lightyellow}Game Port (${port}) - TCP Output${default}" fn_messages_separator echo -e "" echo -e "${lightgreen}TCP Raw Output${default}" fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do - echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''" + echo -e "${italic}bash -c 'exec 3<> /dev/tcp/'\"${queryip}\"'/'\"${port}\"''${default}" echo -e "" - timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}'' + timeout 3 bash -c 'exec 3<> /dev/tcp/'"${queryip}"'/'"${port}"'' querystatus="$?" echo -e "" if [ "${querystatus}" == "0" ]; then @@ -267,10 +280,10 @@ for queryip in "${queryips[@]}"; do fi done echo -e "" -echo -e "${lightgreen}Steam Master Server Response${default}" +echo -e "${bold}${lightyellow}Steam Master Server Response${default}" fn_messages_separator echo -e "" -echo -e "curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}" +echo -e "${italic}curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}${default}" echo -e "" echo -e "Response: ${displaymasterserver}" echo -e "" diff --git a/lgsm/modules/command_dev_ui.sh b/lgsm/modules/command_dev_ui.sh new file mode 100755 index 000000000..e7aa9975e --- /dev/null +++ b/lgsm/modules/command_dev_ui.sh @@ -0,0 +1,110 @@ +#!/bin/bash +# LinuxGSM command_dev_ui.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Dev only: Assist with UI development. + +commandname="DEV-DEBUG" +commandaction="Developer UI" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_header + +# Load ANSI colors +fn_ansi_loader + +fn_print_nl "" +fn_print_nl "${lightgreen}Colours${default}" +fn_messages_separator +# Print supported colors +fn_print_nl "${default}default" +fn_print_nl "${black}black${default}" +fn_print_nl "${red}red${default}" +fn_print_nl "${lightred}lightred${default}" +fn_print_nl "${green}green${default}" +fn_print_nl "${lightgreen}lightgreen${default}" +fn_print_nl "${yellow}yellow${default}" +fn_print_nl "${lightyellow}lightyellow${default}" +fn_print_nl "${blue}blue${default}" +fn_print_nl "${lightblue}lightblue${default}" +fn_print_nl "${magenta}magenta${default}" +fn_print_nl "${lightmagenta}lightmagenta${default}" +fn_print_nl "${cyan}cyan${default}" +fn_print_nl "${lightcyan}lightcyan${default}" +fn_print_nl "${darkgrey}darkgrey${default}" +fn_print_nl "${lightgrey}lightgrey${default}" +fn_print_nl "${white}white${default}" +fn_print_nl "${bold}bold${default}" +fn_print_nl "${dim}dim${default}" +fn_print_nl "${italic}italic${default}" +fn_print_nl "${underline}underline${default}" +fn_print_nl "${reverse}reverse${default}" + +fn_print_nl "" +fn_print_nl "${lightgreen}Non Interactive UI Status Messages${default}" +fn_messages_separator +fn_print_nl "" +fn_print_nl "Print Message" +fn_print_nl "" +fn_print_nl "${lightgreen}Status Messages${default}" +fn_messages_separator +fn_print_dots_nl "Dots" +fn_print_ok_nl "OK" +fn_print_fail_nl "Fail" +fn_print_error_nl "Error" +fn_print_warn_nl "Warn" +fn_print_info_nl "Info" +fn_print_start_nl "Start" + +fn_print_nl "" +fn_print_nl "${lightgreen}Interactive UI Status Messages${default}" +fn_messages_separator +fn_print_success_nl +fn_print_failure_nl +fn_print_error2_nl +fn_print_warning_nl +fn_print_information_nl + +fn_print_nl "" +fn_print_nl "${lightgreen}EOL Status Messages${default}" +fn_messages_separator + +fn_print "Print yes message with eol" +fn_print_yes_eol_nl +fn_print "Print no message with eol" +fn_print_no_eol_nl +fn_print "Print ok message with eol" +fn_print_ok_eol_nl +fn_print "Print fail message with eol" +fn_print_fail_eol_nl +fn_print "Print error message with eol" +fn_print_error_eol_nl +fn_print "Print warn message with eol" +fn_print_wait_eol_nl +fn_print "Print info message with eol" +fn_print_warn_eol_nl +fn_print "Print querying message with eol" +fn_print_info_eol_nl +fn_print "Print checking message with eol" +fn_print_querying_eol_nl +fn_print "Print delay message with eol" +fn_print_checking_eol_nl +fn_print "Print canceled message with eol" +fn_print_delay_eol_nl +fn_print "Print removed message with eol" +fn_print_canceled_eol_nl +fn_print "Print update message with eol" +fn_print_removed_eol_nl +fn_print "Print skip message with eol" +fn_print_update_eol_nl +fn_print "Print skip message with eol" +fn_print_skip_eol_nl + +fn_print_nl "" +fn_print_nl "${lightgreen}Restart warning${default}" +fn_messages_separator +fn_print_restart_warning + +core_exit.sh diff --git a/lgsm/modules/command_fastdl.sh b/lgsm/modules/command_fastdl.sh old mode 100644 new mode 100755 index 4e9378945..dfdcc9ec8 --- a/lgsm/modules/command_fastdl.sh +++ b/lgsm/modules/command_fastdl.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Creates a FastDL directory. +# Description: Creates a Fastdl directory. commandname="FASTDL" commandaction="Fastdl" @@ -21,27 +21,20 @@ luasvautorundir="${systemdir}/lua/autorun/server" luafastdlfile="lgsm_cl_force_fastdl.lua" luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" -# Check if bzip2 is installed. -if [ ! "$(command -v bzip2 2> /dev/null)" ]; then - fn_print_fail "bzip2 is not installed" - fn_script_log_fail "bzip2 is not installed" - core_exit.sh -fi - # Header fn_print_header -echo -e "More info: https://docs.linuxgsm.com/commands/fastdl" -echo -e "" +fn_print_nl "More info: ${italic}https://docs.linuxgsm.com/commands/fastdl" +fn_print_nl "" -# Prompts user for FastDL creation settings. -echo -e "${commandaction} setup" +# Prompts user for Fastdl creation settings. +fn_print_nl "${bold}${lightyellow}${commandaction} Setup" fn_messages_separator # Prompt for clearing old files if directory was already here. if [ -d "${fastdldir}" ]; then - fn_print_warning_nl "FastDL directory already exists." - echo -e "${fastdldir}" - echo -e "" + fn_print_warning_nl "Fastdl directory already exists." + fn_print_nl "${fastdldir}" + fn_print_nl "" if fn_prompt_yn "Overwrite existing directory?" Y; then fn_script_log_info "Overwrite existing directory: YES" else @@ -63,18 +56,18 @@ fi # Clears any fastdl directory content. fn_clear_old_fastdl() { - # Clearing old FastDL. + # Clearing old Fastdl. if [ -d "${fastdldir}" ]; then - echo -en "clearing existing FastDL directory ${fastdldir}..." + fn_print "clearing existing Fastdl directory ${fastdldir}" rm -rf "${fastdldir:?}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fail "Clearing existing FastDL directory ${fastdldir}" + fn_script_log_fail "Clearing existing Fastdl directory ${fastdldir}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "Clearing existing FastDL directory ${fastdldir}" + fn_script_log_pass "Clearing existing Fastdl directory ${fastdldir}" fi fi } @@ -82,10 +75,10 @@ fn_clear_old_fastdl() { fn_fastdl_dirs() { # Check and create directories. if [ ! -d "${webdir}" ]; then - echo -en "creating web directory ${webdir}..." + fn_print "creating web directory ${webdir}" mkdir -p "${webdir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Creating web directory ${webdir}" core_exit.sh @@ -95,10 +88,10 @@ fn_fastdl_dirs() { fi fi if [ ! -d "${fastdldir}" ]; then - echo -en "creating fastdl directory ${fastdldir}..." + fn_print "creating fastdl directory ${fastdldir}" mkdir -p "${fastdldir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Creating fastdl directory ${fastdldir}" core_exit.sh @@ -112,20 +105,20 @@ fn_fastdl_dirs() { # 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 + "1152921504606846976:ZB" + "1125899906842624:EB" + "1099511627776:TB" + "1073741824:GB" + "1048576:MB" + "1024:KB" + "1:bytes" ) local bytes="${1}" local precision="${2}" if [[ "${bytes}" == "1" ]]; then - echo -e "1 byte" + fn_print_nl "1 byte" else for item in "${abbrevs[@]}"; do local factor="${item%:*}" @@ -145,7 +138,7 @@ fn_fastdl_preview() { if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then rm -f "${tmpdir:?}/fastdl_files_to_compress.txt" fi - echo -e "analysing required files" + fn_print_nl "analysing required files" fn_script_log_info "Analysing required files" # Garry's Mod if [ "${shortname}" == "gmod" ]; then @@ -158,13 +151,13 @@ fn_fastdl_preview() { ((fileswc++)) tput rc tput el - echo -e "gathering ${allowed_extention} : ${fileswc}..." + fn_print "gathering ${allowed_extention} : ${fileswc}" echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" done < <(find . -type f -iname "${allowed_extention}") if [ ${fileswc} != 0 ]; then fn_print_ok_eol_nl else - fn_print_info_eol_nl + fn_print_skip_eol_nl fi done # Source engine @@ -190,12 +183,12 @@ fn_fastdl_preview() { ((fileswc++)) tput rc tput el - echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." + fn_print "gathering ${directory} ${allowed_extention} : ${fileswc}" echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" done < <(find "${systemdir}/${directory}" -type f -iname "${allowed_extention}") tput rc tput el - echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." + fn_print "gathering ${directory} ${allowed_extention} : ${fileswc}" if [ ${fileswc} != 0 ]; then fn_print_ok_eol_nl else @@ -206,7 +199,7 @@ fn_fastdl_preview() { done fi if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then - echo -e "calculating total file size..." + fn_print_nl "calculating total file size" fn_sleep_time_1 totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") # Calculates total file size. @@ -214,9 +207,9 @@ fn_fastdl_preview() { filesize=$(stat -c %s "${dufile}") filesizetotal=$((filesizetotal + filesize)) exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fail "Calculating total file size." + fn_script_log_fail "Calculating total file size" core_exit.sh fi done < "${tmpdir}/fastdl_files_to_compress.txt" @@ -225,11 +218,17 @@ fn_fastdl_preview() { fn_script_log_fail "Generating file list." core_exit.sh fi - echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" - fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + + if [ "${engine}" == "source" ]; then + echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" + elif [ "${engine}" == "goldsrc" ]; then + echo -e "about to copy ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" + fi + + fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" rm -f "${tmpdir:?}/fastdl_files_to_compress.txt" if ! fn_prompt_yn "Continue?" Y; then - fn_script_log "User exited" + exitcode=0 core_exit.sh fi } @@ -244,10 +243,10 @@ fn_fastdl_gmod() { ((fileswc++)) tput rc tput el - echo -e "copying ${allowed_extention} : ${fileswc}..." + fn_print "copying ${allowed_extention} : ${fileswc}" cp --parents "${fastdlfile}" "${fastdldir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}" core_exit.sh @@ -259,12 +258,12 @@ fn_fastdl_gmod() { fn_print_ok_eol_nl fi done - # Correct addons directory structure for FastDL. + # Correct addons directory structure for Fastdl. if [ -d "${fastdldir}/addons" ]; then - echo -en "updating addons file structure..." + fn_print "updating addons file structure..." cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Updating addons file structure" core_exit.sh @@ -273,11 +272,11 @@ fn_fastdl_gmod() { fn_script_log_pass "Updating addons file structure" fi # Clear addons directory in fastdl. - echo -en "clearing addons dir from fastdl dir..." + fn_print "clearing addons dir from fastdl dir..." fn_sleep_time_1 rm -rf "${fastdldir:?}/addons" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Clearing addons dir from fastdl dir" core_exit.sh @@ -288,11 +287,11 @@ fn_fastdl_gmod() { fi # Correct content that may be into a lua directory by mistake like some darkrpmodification addons. if [ -d "${fastdldir}/lua" ]; then - echo -en "correcting DarkRP files..." + fn_print "correcting DarkRP files..." fn_sleep_time_1 cp -Rf "${fastdldir}/lua/"* "${fastdldir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Correcting DarkRP files" core_exit.sh @@ -332,8 +331,8 @@ fn_fastdl_source() { ((fileswc++)) tput rc tput el - echo -e "copying ${directory} ${allowed_extention} : ${fileswc}..." - fn_sleep_time_1 + fn_print "copying ${directory} ${allowed_extention} : ${fileswc}" + fn_sleep_time # get relative path of file in the dir tmprelfilepath="${fastdlfile#"${systemdir}/"}" copytodir="${tmprelfilepath%/*}" @@ -343,7 +342,7 @@ fn_fastdl_source() { fi cp "${fastdlfile}" "${fastdldir}/${copytodir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" core_exit.sh @@ -361,8 +360,8 @@ fn_fastdl_source() { # Builds the fastdl directory content. fn_fastdl_build() { - # Copy all needed files for FastDL. - echo -e "copying files to ${fastdldir}" + # Copy all needed files for Fastdl. + fn_print_nl "copying files to ${fastdldir}" fn_script_log_info "Copying files to ${fastdldir}" if [ "${shortname}" == "gmod" ]; then fn_fastdl_gmod @@ -372,14 +371,14 @@ fn_fastdl_build() { fi } -# Generate lua file that will force download any file into the FastDL directory. +# Generate lua file that will force download any file into the Fastdl directory. fn_fastdl_gmod_dl_enforcer() { # Clear old lua file. if [ -f "${luafastdlfullpath}" ]; then - echo -en "removing existing download enforcer: ${luafastdlfile}..." + fn_print "removing existing download enforcer: ${luafastdlfile}" rm -f "${luafastdlfullpath:?}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Removing existing download enforcer ${luafastdlfullpath}" core_exit.sh @@ -390,14 +389,14 @@ fn_fastdl_gmod_dl_enforcer() { fi # Generate new one if user said yes. if [ "${luaresource}" == "on" ]; then - echo -en "creating new download enforcer: ${luafastdlfile}..." + fn_print "creating new download enforcer: ${luafastdlfile}" touch "${luafastdlfullpath}" # Read all filenames and put them into a lua file at the right path. while read -r line; do echo -e "resource.AddFile( \"${line}\" )" >> "${luafastdlfullpath}" done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n') exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Creating new download enforcer ${luafastdlfullpath}" core_exit.sh @@ -408,21 +407,21 @@ fn_fastdl_gmod_dl_enforcer() { fi } -# Compresses FastDL files using bzip2. +# Compresses Fastdl files using bzip2. fn_fastdl_bzip2() { while read -r filetocompress; do - echo -en "\r\033[Kcompressing ${filetocompress}..." + fn_print "compressing ${filetocompress}" bzip2 -f "${filetocompress}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Compressing ${filetocompress}" core_exit.sh else + fn_print_ok_eol_nl fn_script_log_pass "Compressing ${filetocompress}" fi done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \)) - fn_print_ok_eol_nl } check.sh @@ -431,11 +430,13 @@ fn_fastdl_preview fn_clear_old_fastdl fn_fastdl_dirs fn_fastdl_build -fn_fastdl_bzip2 +if [ "${engine}" == "source" ]; then + fn_fastdl_bzip2 +fi # Finished message. -echo -e "FastDL files are located in:" -echo -e "${fastdldir}" -echo -e "FastDL completed" -fn_script_log_info "FastDL completed" +fn_print_nl "Fastdl files are located in:" +fn_print_nl "${fastdldir}" +fn_print_nl "Fastdl completed" +fn_script_log_info "Fastdl completed" core_exit.sh diff --git a/lgsm/modules/command_install.sh b/lgsm/modules/command_install.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_install_resources_mta.sh b/lgsm/modules/command_install_resources_mta.sh old mode 100644 new mode 100755 index aecda1452..7eca4fb97 --- a/lgsm/modules/command_install_resources_mta.sh +++ b/lgsm/modules/command_install_resources_mta.sh @@ -12,7 +12,7 @@ fn_firstcommand_set fn_install_resources() { echo -e "" - echo -e "${lightyellow}Installing Default Resources${default}" + echo -e "${bold}${lightyellow}Installing Default Resources${default}" fn_messages_separator fn_fetch_file "http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip" "" "" "" "${tmpdir}" "mtasa-resources-latest.zip" "nochmodx" "norun" "noforce" "nohash" fn_dl_extract "${tmpdir}" "mtasa-resources-latest.zip" "${resourcesdir}" diff --git a/lgsm/modules/command_mods_install.sh b/lgsm/modules/command_mods_install.sh old mode 100644 new mode 100755 index d1b3fb67a..a8f90293b --- a/lgsm/modules/command_mods_install.sh +++ b/lgsm/modules/command_mods_install.sh @@ -6,7 +6,7 @@ # Description: List and installs available mods along with mods_list.sh and mods_core.sh. commandname="MODS-INSTALL" -commandaction="Installing mods" +commandaction="Installing Mods" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set @@ -47,7 +47,7 @@ while [ "${compatiblemodslistindex}" -lt "${#compatiblemodslist[@]}" ]; do echo -e "${displayedmodname} - ${displayedmoddescription} - ${displayedmodsite}" echo -e " * ${cyan}${displayedmodcommand}${default}" # Increment index from the amount of values we just displayed. - let "compatiblemodslistindex+=4" + ((compatiblemodslistindex += 4)) ((totalmodsavailable++)) done @@ -61,16 +61,29 @@ fn_script_log_info "${totalmodsavailable} addons/mods are available for install" ## User selects a mod. echo -e "" -while [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; do + +while :; 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 + + validselection=0 + for availablemodcommand in "${availablemodscommands[@]}"; do + if [ "${availablemodcommand}" == "${usermodselect}" ]; then + validselection=1 + break + fi + done + + if [ "${validselection}" -eq 1 ]; then + break + fi + + # Supplementary output upon invalid user input. + fn_print_error2_nl "${usermodselect} is not a valid addon/mod." done # Get mod info. currentmod="${usermodselect}" @@ -88,6 +101,7 @@ if [ -f "${modsinstalledlistfullpath}" ]; then fn_script_log_warn "${modprettyname} is already installed" echo -e " * Any configs may be overwritten." if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 core_exit.sh fi fn_script_log_info "User selected to continue" diff --git a/lgsm/modules/command_mods_remove.sh b/lgsm/modules/command_mods_remove.sh old mode 100644 new mode 100755 index 412e07546..04240eb60 --- a/lgsm/modules/command_mods_remove.sh +++ b/lgsm/modules/command_mods_remove.sh @@ -6,7 +6,7 @@ # Description: Uninstall mods along with mods_list.sh and mods_core.sh. commandname="MODS-REMOVE" -commandaction="Removing mods" +commandaction="Removing Mods" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set @@ -32,21 +32,35 @@ done echo -e "" # Keep prompting as long as the user input doesn't correspond to an available mod. -while [[ ! " ${installedmodslist[@]} " =~ " ${usermodselect} " ]]; do + +while :; 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 + + validselection=0 + for installedmodcommand in "${installedmodslist[@]}"; do + if [ "${installedmodcommand}" == "${usermodselect}" ]; then + validselection=1 + break + fi + done + + if [ "${validselection}" -eq 1 ]; then + break + fi + + # Supplementary output upon invalid user input. + fn_print_error2_nl "${usermodselect} is not a valid addon/mod." done fn_print_warning_nl "You are about to remove ${cyan}${usermodselect}${default}." echo -e " * Any custom files/configuration will be removed." if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 core_exit.sh fi @@ -70,8 +84,8 @@ while [ "${modfileline}" -le "${modsfilelistsize}" ]; do if [ -f "${modinstalldir}/${currentfileremove}" ] || [ -d "${modinstalldir}/${currentfileremove}" ]; then rm -rf "${modinstalldir:?}/${currentfileremove:?}" - ((exitcode = $?)) - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "Removing ${modinstalldir}/${currentfileremove}" break else @@ -87,7 +101,7 @@ done # Added logic not to fail since removing game specific mods (amxmodxcs) removes files that will # not be found when removing the base (amxmodx) mod if [ "${modcommand}" != "amxmodx" ]; then - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl core_exit.sh else @@ -102,7 +116,7 @@ echo -en "removing ${modcommand}-files.txt..." fn_sleep_time_1 rm -rf "${modsdir:?}/${modcommand}-files.txt" exitcode=$? -if [ "${exitcode}" != 0 ]; then +if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "Removing ${modsdir}/${modcommand}-files.txt" fn_print_fail_eol_nl core_exit.sh @@ -117,7 +131,7 @@ fn_sleep_time_1 sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}" exitcode=$? -if [ "${exitcode}" != 0 ]; then +if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "Removing ${modcommand} from ${modsinstalledlist}" fn_print_fail_eol_nl core_exit.sh diff --git a/lgsm/modules/command_mods_update.sh b/lgsm/modules/command_mods_update.sh old mode 100644 new mode 100755 index ca81dd947..10279b67b --- a/lgsm/modules/command_mods_update.sh +++ b/lgsm/modules/command_mods_update.sh @@ -6,7 +6,7 @@ # Description: Updates installed mods along with mods_list.sh and mods_core.sh. commandname="MODS-UPDATE" -commandaction="Updating mods" +commandaction="Updating Mods" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh old mode 100644 new mode 100755 index a9691fb98..7c813aed7 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -18,10 +18,10 @@ fn_monitor_check_monitoring() { date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock" elif [ ! -f "${lockdir}/${selfname}-monitoring.lock" ]; then # Monitor does not run if lockfile is not found. - fn_print_dots "Checking lockfile: " + fn_print_dots "Checking lockfile" fn_print_checking_eol fn_script_log_info "Checking lockfile: CHECKING" - fn_print_error "Checking lockfile: No lockfile found: " + fn_print_error "Checking lockfile: No lockfile found" fn_print_error_eol_nl fn_script_log_error "Checking lockfile: No lockfile found: ERROR" echo -e "* Start ${selfname} to run monitor." @@ -31,10 +31,10 @@ fn_monitor_check_monitoring() { fn_monitor_check_install() { if [ "$(pgrep -fc -u "${USER}" "/bin/bash ./${selfname} install")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} i")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} auto-install")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} ai")" != "0" ]; then - fn_print_dots "Checking installer: " + fn_print_dots "Checking installer" fn_print_checking_eol fn_script_log_info "Checking installer: CHECKING" - fn_print_info "Checking installer: LinuxGSM is installing: " + fn_print_info "Checking installer: LinuxGSM is installing" fn_print_info_eol_nl fn_script_log_pass "Checking installer: LinuxGSM is installing" core_exit.sh @@ -43,9 +43,9 @@ fn_monitor_check_install() { fn_monitor_check_debug() { if [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} debug")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} d")" != "0" ]; then - fn_print_dots "Checking debug: " + fn_print_dots "Checking debug" fn_print_checking_eol - fn_print_info "Checking debug: Debug is running: " + fn_print_info "Checking debug: Debug is running" fn_print_info_eol_nl fn_script_log_pass "Checking debug: Debug is running" core_exit.sh @@ -54,9 +54,9 @@ fn_monitor_check_debug() { fn_monitor_check_details() { if [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} details")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} dt")" != "0" ]; then - fn_print_dots "Checking details: " + fn_print_dots "Checking details" fn_print_checking_eol - fn_print_info "Checking details: Details is running: " + fn_print_info "Checking details: Details is running" fn_print_info_eol_nl fn_script_log_pass "Checking details: Details is running" core_exit.sh @@ -67,9 +67,9 @@ fn_monitor_check_starting() { # Remove stale lockfile. if [ -f "${lockdir}/${selfname}-starting.lock" ]; then if [ "$(find "${lockdir}/${selfname}-starting.lock" -mmin +5)" ]; then - fn_print_dots "Checking start: " + fn_print_dots "Checking start" fn_print_checking_eol - fn_print_warn "Checking start: Removing stale lockfile: " + fn_print_warn "Checking start: Removing stale lockfile" fn_print_warn_eol_nl fn_script_log_warn "Checking start: Removing stale lockfile" rm -f "${lockdir:?}/${selfname}-starting.lock" @@ -77,9 +77,9 @@ fn_monitor_check_starting() { fi if [ -f "${lockdir}/${selfname}-starting.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} start")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} s")" != "0" ]]; then - fn_print_dots "Checking start: " + fn_print_dots "Checking start" fn_print_checking_eol - fn_print_info "Checking start: LinuxGSM is starting: " + fn_print_info "Checking start: LinuxGSM is starting" fn_print_info_eol_nl fn_script_log_info "Checking backup: LinuxGSM is starting" core_exit.sh @@ -90,9 +90,9 @@ fn_monitor_check_stopping() { # Remove stale lockfile. if [ -f "${lockdir}/${selfname}-stopping.lock" ]; then if [ "$(find "${lockdir}/${selfname}-stopping.lock" -mmin +5)" ]; then - fn_print_dots "Checking stop: " + fn_print_dots "Checking stop" fn_print_checking_eol - fn_print_warn "Checking stop: Removing stale lockfile: " + fn_print_warn "Checking stop: Removing stale lockfile" fn_print_warn_eol_nl fn_script_log_warn "Checking stop: Removing stale lockfile" rm -f "${lockdir:?}/${selfname}-stopping.lock" @@ -100,9 +100,9 @@ fn_monitor_check_stopping() { fi if [ -f "${lockdir}/${selfname}-stopping.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} stop")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} s")" != "0" ]]; then - fn_print_dots "Checking stop: " + fn_print_dots "Checking stop" fn_print_checking_eol - fn_print_info "Checking stop: LinuxGSM is stopping: " + fn_print_info "Checking stop: LinuxGSM is stopping" fn_print_info_eol_nl fn_script_log_info "Checking backup: LinuxGSM is stopping" core_exit.sh @@ -113,9 +113,9 @@ fn_monitor_check_backup() { # Remove stale lockfile. if [ -f "${lockdir}/backup.lock" ]; then if [ "$(find "${lockdir}/backup.lock" -mmin +60)" ]; then - fn_print_dots "Checking backup: " + fn_print_dots "Checking backup" fn_print_checking_eol - fn_print_warn "Checking backup: Removing stale lockfile: " + fn_print_warn "Checking backup: Removing stale lockfile" fn_print_warn_eol fn_script_log_warn "Checking backup: Removing stale lockfile" rm -f "${lockdir:?}/backup.lock" @@ -123,9 +123,9 @@ fn_monitor_check_backup() { fi if [ -f "${lockdir}/backup.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} backup")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} b")" != "0" ]]; then - fn_print_dots "Checking backup: " + fn_print_dots "Checking backup" fn_print_checking_eol - fn_print_info "Checking backup: Backup is running: " + fn_print_info "Checking backup: Backup is running" fn_print_info_eol_nl fn_script_log_info "Checking backup: Backup is running" core_exit.sh @@ -136,9 +136,9 @@ fn_monitor_check_update() { # Remove stale lockfile. if [ -f "${lockdir}/update.lock" ]; then if [ "$(find "${lockdir}/update.lock" -mmin +15)" ]; then - fn_print_dots "Checking update: " + fn_print_dots "Checking update" fn_print_checking_eol - fn_print_warn "Checking update: Removing stale lockfile: " + fn_print_warn "Checking update: Removing stale lockfile" fn_print_warn_eol_nl fn_script_log_warn "Checking update: Removing stale lockfile" rm -f "${lockdir:?}/update.lock" @@ -146,9 +146,9 @@ fn_monitor_check_update() { fi if [ -f "${lockdir}/update.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} update")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} validate")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} v")" != "0" || "$(pgrep -fc force-update "${USER}" "/bin/bash ./${selfname} fu")" != "0" ]]; then - fn_print_dots "Checking update: " + fn_print_dots "Checking update" fn_print_checking_eol - fn_print_info "Checking update: LinuxGSM is updating the game server: " + fn_print_info "Checking update: LinuxGSM is updating the game server" fn_print_info_eol_nl fn_script_log_pass "Checking update: LinuxGSM is updating the game server" core_exit.sh @@ -159,22 +159,22 @@ fn_monitor_check_update() { fn_monitor_check_update_source() { if [ -f "${consolelogdir}/${selfname}-console.log" ] && [ "${engine}" == "source" ]; then if grep -q "Your server needs to be restarted in order to receive the latest update." "${consolelogdir}/${selfname}-console.log"; then - fn_print_dots "Checking update: " + fn_print_dots "Checking update" fn_print_checking_eol fn_script_log_info "Checking update: CHECKING" - fn_print_ok "Checking update: " + fn_print_ok "Checking update" fn_print_ok_eol_nl - fn_script_log_info "Checking update: ${selfname} has requested an update and needs to be restarted" - alert="update-request" + fn_script_log_info "Checking update: ${selfname} has requested a restart for an update to be applied" + alert="update-restart-request" alert.sh - command_update.sh + command_restart.sh core_exit.sh fi fi } fn_monitor_check_session() { - fn_print_dots "Checking session: " + fn_print_dots "Checking session" fn_print_checking_eol fn_script_log_info "Checking session: CHECKING" # Tmux session width and height needs to be reviewed as may no longer be required. @@ -182,7 +182,7 @@ fn_monitor_check_session() { sessionheight="23" # Check for PIDS with identical tmux sessions running. if [ "$(pgrep -fcx "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" -ge "2" ]; then - fn_print_error "Checking session: There are PIDS with identical tmux sessions running: " + fn_print_error "Checking session: There are PIDS with identical tmux sessions running" fn_print_error_eol_nl fn_script_log_error "Checking session: ERROR" fn_script_log_error "Checking session: There are PIDS with identical tmux sessions running" @@ -192,7 +192,7 @@ fn_monitor_check_session() { core_exit.sh # Check for tmux pids with the same tmux session and socket names. This will reduce issues with migration to release v23.5.0. #4296 elif [ "$(pgrep -fc -u "${USER}" "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then - fn_print_error "Checking session: PIDS with the same tmux session and socket names are running: " + fn_print_error "Checking session: PIDS with the same tmux session and socket names are running" fn_print_error_eol_nl fn_script_log_error "Checking session: ERROR" fn_script_log_error "Checking session: PIDS with the same tmux session and socket names are running" @@ -202,7 +202,7 @@ fn_monitor_check_session() { core_exit.sh # Check for tmux pids that are using the old type of tmux session. This will reduce issues with migration to release v23.5.0. #4296 elif [ "$(pgrep -fc -u "${USER}" "tmux new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then - fn_print_error "Checking session: PIDS with old type tmux session are running: " + fn_print_error "Checking session: PIDS with old type tmux session are running" fn_print_error_eol_nl fn_script_log_error "Checking session: ERROR" fn_script_log_error "Checking session: PIDS with old type tmux session are running" @@ -211,7 +211,7 @@ fn_monitor_check_session() { command_restart.sh core_exit.sh elif [ "${status}" != "0" ]; then - fn_print_ok "Checking session: " + fn_print_ok "Checking session" fn_print_ok_eol_nl fn_script_log_pass "Checking session: OK" # send LinuxGSM stats if monitor is OK. @@ -219,7 +219,7 @@ fn_monitor_check_session() { info_stats.sh fi else - fn_print_error "Checking session: " + fn_print_error "Checking session" fn_print_fail_eol_nl fn_script_log_fail "Checking session: FAIL" alert="monitor-session" @@ -233,7 +233,7 @@ fn_monitor_check_session() { # Monitor will check queryport is set before continuing. fn_monitor_check_queryport() { if [ -z "${queryport}" ] || [ "${queryport}" == "0" ]; then - fn_print_dots "Checking port: " + fn_print_dots "Checking port" fn_print_checking_eol fn_script_log_info "Checking port: CHECKING" if [ -n "${rconenabled}" ] && [ "${rconenabled}" != "true" ] && [ "${shortname}" == "av" ]; then @@ -266,12 +266,12 @@ fn_monitor_query() { totalseconds=0 for queryattempt in {1..5}; do for queryip in "${queryips[@]}"; do - fn_print_dots "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_dots "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}" fn_print_querying_eol fn_script_log_info "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : QUERYING" # querydelay if [ "$(head -n 1 "${lockdir}/${selfname}-started.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then - fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}" fn_print_delay_eol_nl fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : DELAY" fn_script_log_info "Query bypassed: ${gameservername} started less than ${querydelay} minutes ago" @@ -293,7 +293,7 @@ fn_monitor_query() { if [ "${querystatus}" == "0" ]; then # Server query OK. - fn_print_ok "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_ok "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}" fn_print_ok_eol_nl fn_script_log_pass "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : OK" monitorpass=1 @@ -323,14 +323,14 @@ fn_monitor_query() { core_exit.sh else # Server query FAIL. - fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}" fn_print_fail_eol fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : FAIL" # Monitor will try gamedig (if supported) for first 30s then gsquery before restarting. # gsquery will fail if longer than 60s if [ "${totalseconds}" -ge "59" ]; then # Monitor will FAIL if over 60s and trigger gane server reboot. - fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}" fn_print_fail_eol_nl fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : FAIL" # Send alert if enabled. @@ -344,7 +344,8 @@ fn_monitor_query() { done # Second counter will wait for 15s before breaking loop. for seconds in {1..15}; do - fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt} : ${cyan}WAIT${default}" + fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}" + fn_print_wait_eol fn_sleep_time_1 totalseconds=$((totalseconds + 1)) if [ "${seconds}" == "15" ]; then diff --git a/lgsm/modules/command_postdetails.sh b/lgsm/modules/command_postdetails.sh old mode 100644 new mode 100755 index 6626d51a7..d029093b5 --- a/lgsm/modules/command_postdetails.sh +++ b/lgsm/modules/command_postdetails.sh @@ -6,20 +6,18 @@ # Description: Strips sensitive information out of Details output. commandname="POST-DETAILS" -commandaction="Posting details" +commandaction="Post Details" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -posttarget="https://termbin.com" - -# source all of the modules defined in the details command. -info_messages.sh - fn_bad_postdetailslog() { fn_print_fail_nl "Unable to create temporary file ${postdetailslog}." core_exit.sh } +# source all of the modules defined in the details command. +info_messages.sh + # Remove any existing postdetails.log file. if [ -f "${postdetailslog}" ]; then rm -f "${postdetailslog:?}" @@ -48,7 +46,7 @@ else fn_info_messages_gameserver fn_info_messages_script fn_info_messages_backup - # Some game servers do not have parms. + # Some game servers do not have params. if [ "${shortname}" != "jc2" ] && [ "${shortname}" != "jc3" ] && [ "${shortname}" != "dst" ] && [ "${shortname}" != "pz" ] && [ "${engine}" != "renderware" ]; then fn_info_messages_commandlineparms fi @@ -60,18 +58,27 @@ else fi fn_print_dots "termbin.com" -link=$(cat "${postdetailslog}" | nc termbin.com 9999 | tr -d '\n\0') -fn_print_ok_nl "termbin.com for 30D" -fn_script_log_pass "termbin.com for 30D" -pdurl="${link}" +link=$(cat "${postdetailslog}" | { + nc -w 10 termbin.com 9999 + echo $? > /tmp/nc_exit_status +} | tr -d '\n\0') +nc_exit_status=$(cat /tmp/nc_exit_status) +if [ "${nc_exit_status}" -ne 0 ]; then + fn_print_error_nl "Failed to post to termbin.com" + fn_script_log_error "Failed to post to termbin.com" +else + fn_print_ok_nl "termbin.com for 30D" + fn_script_log_pass "termbin.com for 30D" + pdurl="${link}" -if [ "${firstcommandname}" == "POST-DETAILS" ]; then - echo -e "" - echo -e "Please share the following url for support: " - echo -e "${pdurl}" + if [ "${firstcommandname}" == "POST-DETAILS" ]; then + echo -e "" + echo -e "Please share the following url for support: " + echo -e "${italic}${pdurl}${default}" + fi + fn_script_log_info "${pdurl}" + alerturl="${pdurl}" fi -fn_script_log_info "${pdurl}" -alerturl="${pdurl}" if [ -z "${exitbypass}" ]; then core_exit.sh diff --git a/lgsm/modules/command_restart.sh b/lgsm/modules/command_restart.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_send.sh b/lgsm/modules/command_send.sh old mode 100644 new mode 100755 index e31452707..20ef188e3 --- a/lgsm/modules/command_send.sh +++ b/lgsm/modules/command_send.sh @@ -26,16 +26,12 @@ if [ "${status}" != "0" ]; then fi echo "" fn_print_dots "Sending command to console: \"${commandtosend}\"" - tmux -L "${socketname}" send-keys -t "${sessionname}" "${commandtosend}" ENTER fn_print_ok_nl "Sending command to console: \"${commandtosend}\"" + tmux -L "${socketname}" send-keys -t "${sessionname}" "${commandtosend}" ENTER fn_script_log_pass "Command \"${commandtosend}\" sent to console" else - fn_print_error_nl "Server not running" - fn_script_log_error "Failed to access: Server not running" - if fn_prompt_yn "Do you want to start the server?" Y; then - exitbypass=1 - command_start.sh - fi + fn_print_error_nl "Unable to send command to console. Server not running" + fn_script_log_error "Unable to send command to console. Server not running" fi core_exit.sh diff --git a/lgsm/modules/command_skeleton.sh b/lgsm/modules/command_skeleton.sh old mode 100644 new mode 100755 index ca32610e9..3e07edc3a --- a/lgsm/modules/command_skeleton.sh +++ b/lgsm/modules/command_skeleton.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Creates an copy of a game servers directorys. +# Description: Creates a copy of a game server directories. commandname="SKELETON" commandaction="Skeleton" @@ -13,10 +13,10 @@ fn_firstcommand_set fn_print_dots "Creating skeleton directory" check.sh -# Find all directorys and create them in the skel directory +# Find all directories and create them in the skel directory find "${rootdir}" -type d -not \( -path ./skel -prune \) | cpio -pdvm skel 2> /dev/null exitcode=$? -if [ "${exitcode}" != 0 ]; then +if [ "${exitcode}" -ne 0 ]; then fn_print_fail_nl "Creating skeleton directory" fn_script_log_fail "Creating skeleton directory" else diff --git a/lgsm/modules/command_sponsor.sh b/lgsm/modules/command_sponsor.sh index e7aeeda95..1915aa328 100755 --- a/lgsm/modules/command_sponsor.sh +++ b/lgsm/modules/command_sponsor.sh @@ -11,7 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_print_ascii_logo -echo -e "${lightyellow}Support LinuxGSM${default}" +echo -e "${bold}${lightyellow}Support LinuxGSM${default}" fn_messages_separator echo -e "" echo -e "Been using LinuxGSM?" diff --git a/lgsm/modules/command_start.sh b/lgsm/modules/command_start.sh old mode 100644 new mode 100755 index c2be7ed2f..a4e07b44b --- a/lgsm/modules/command_start.sh +++ b/lgsm/modules/command_start.sh @@ -127,12 +127,12 @@ fn_start_tmux() { echo -e "" echo -e " usermod -G tty $(whoami)" echo -e "" - echo -e "https://linuxgsm.com/tmux-op-perm" + echo -e "${italic}https://linuxgsm.com/tmux-op-perm" fn_script_log_info "https://linuxgsm.com/tmux-op-perm" else echo -e "No known fix currently. Please log an issue." fn_script_log_info "No known fix currently. Please log an issue." - echo -e "https://linuxgsm.com/support" + echo -e "${italic}https://linuxgsm.com/support" fn_script_log_info "https://linuxgsm.com/support" fi fi @@ -176,7 +176,7 @@ check.sh # If the server already started dont start again. if [ "${status}" != "0" ]; then fn_print_dots "${servername}" - fn_print_info_nl "${servername} is already running" + fn_print_skip_nl "${servername} is already running" fn_script_log_error "${servername} is already running" if [ -z "${exitbypass}" ]; then # Remove starting lockfile when command ends. diff --git a/lgsm/modules/command_stop.sh b/lgsm/modules/command_stop.sh old mode 100644 new mode 100755 index 84f5998cd..ab827314d --- a/lgsm/modules/command_stop.sh +++ b/lgsm/modules/command_stop.sh @@ -16,11 +16,11 @@ fn_stop_graceful_ctrlc() { fn_script_log_info "Graceful: CTRL+c" # Sends CTRL+c. tmux -L "${socketname}" send-keys -t "${sessionname}" C-c > /dev/null 2>&1 - # Waits up to 30 seconds giving the server time to shutdown gracefuly. + # Waits up to 30 seconds giving the server time to shutdown gracefully. for seconds in {1..30}; do check_status.sh if [ "${status}" == "0" ]; then - fn_print_ok "Graceful: CTRL+c: ${seconds}: " + fn_print_ok "Graceful: CTRL+c: ${seconds}" fn_print_ok_eol_nl fn_script_log_pass "Graceful: CTRL+c: OK: ${seconds} seconds" if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then @@ -52,7 +52,7 @@ fn_stop_graceful_cmd() { for ((seconds = 1; seconds <= ${2}; seconds++)); do check_status.sh if [ "${status}" == "0" ]; then - fn_print_ok "Graceful: sending \"${1}\": ${seconds}: " + fn_print_ok "Graceful: sending \"${1}\": ${seconds}" fn_print_ok_eol_nl fn_script_log_pass "Graceful: sending \"${1}\": OK: ${seconds} seconds" if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then @@ -85,7 +85,7 @@ fn_stop_graceful_goldsrc() { fn_sleep_time_1 fn_print_dots "Graceful: sending \"quit\": ${seconds}" done - fn_print_ok "Graceful: sending \"quit\": ${seconds}: " + fn_print_ok "Graceful: sending \"quit\": ${seconds}" fn_print_ok_eol_nl fn_script_log_pass "Graceful: sending \"quit\": OK: ${seconds} seconds" if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then @@ -293,11 +293,11 @@ fn_stop_graceful_avorion() { fn_sleep_time_5 # Sends /quit. tmux -L "${socketname}" send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1 - # Waits up to 30 seconds giving the server time to shutdown gracefuly. + # Waits up to 30 seconds giving the server time to shutdown gracefully. for seconds in {1..30}; do check_status.sh if [ "${status}" == "0" ]; then - fn_print_ok "Graceful: /save /stop: ${seconds}: " + fn_print_ok "Graceful: /save /stop: ${seconds}" fn_print_ok_eol_nl fn_script_log_pass "Graceful: /save /stop: OK: ${seconds} seconds" if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then @@ -370,7 +370,7 @@ fn_stop_tmux() { # Checks if the server is already stopped. fn_stop_pre_check() { if [ "${status}" == "0" ]; then - fn_print_info_nl "${servername} is already stopped" + fn_print_skip_nl "${servername} is already stopped" fn_script_log_info "${servername} is already stopped" else # Select graceful shutdown. diff --git a/lgsm/modules/command_test_alert.sh b/lgsm/modules/command_test_alert.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_ts3_server_pass.sh b/lgsm/modules/command_ts3_server_pass.sh old mode 100644 new mode 100755 index 807d025b7..f5fad684e --- a/lgsm/modules/command_ts3_server_pass.sh +++ b/lgsm/modules/command_ts3_server_pass.sh @@ -6,7 +6,7 @@ # Description: Changes TS3 serveradmin password. commandname="CHANGE-PASSWORD" -commandaction="Changing password" +commandaction="Changing Password" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set diff --git a/lgsm/modules/command_update.sh b/lgsm/modules/command_update.sh old mode 100644 new mode 100755 index 6bb30a4c8..a7cfc1b12 --- a/lgsm/modules/command_update.sh +++ b/lgsm/modules/command_update.sh @@ -31,10 +31,14 @@ elif [ "${shortname}" == "jk2" ]; then update_jk2.sh elif [ "${shortname}" == "vints" ]; then update_vints.sh +elif [ "${shortname}" == "bb" ]; then + update_bb.sh elif [ "${shortname}" == "ut99" ]; then update_ut99.sh elif [ "${shortname}" == "xnt" ]; then update_xnt.sh +elif [ "${shortname}" == "etl" ]; then + update_etl.sh else update_steamcmd.sh fi diff --git a/lgsm/modules/command_update_linuxgsm.sh b/lgsm/modules/command_update_linuxgsm.sh old mode 100644 new mode 100755 index eb4226ab8..3fd4cc681 --- a/lgsm/modules/command_update_linuxgsm.sh +++ b/lgsm/modules/command_update_linuxgsm.sh @@ -16,8 +16,9 @@ info_distro.sh info_game.sh # Prevent github from using a cached version of the file if dev-debug is enabled. +nocache=() if [ -f "${rootdir}/.dev-debug" ]; then - nocache="-H \"Cache-Control: no-cache\" -H \"Pragma: no-cache\"" + nocache=(-H "Cache-Control: no-cache" -H "Pragma: no-cache") fi fn_script_log_info "Updating LinuxGSM" @@ -26,11 +27,12 @@ fn_print_dots "Selecting repo" fn_script_log_info "Selecting repo" # Select remotereponame -curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null - -if [ $? != "0" ]; then - curl curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null - if [ $? != "0" ]; then +curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null +exitcode=$? +if [ "${exitcode}" -ne "0" ]; then + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null + exitcode=$? + if [ "${exitcode}" -ne "0" ]; then fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories" fn_script_log_fail "Selecting repo: Unable to to access GitHub or Bitbucket repositories" core_exit.sh @@ -44,62 +46,64 @@ else fi # Check linuxsm.sh -echo -en "checking ${remotereponame} linuxgsm.sh...\c" +echo -en "checking ${remotereponame} script [ ${italic}linuxgsm.sh${default} ]\c" if [ "${remotereponame}" == "GitHub" ]; then - curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null else - curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null fi -if [ $? != "0" ]; then +exitcode=$? +if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Checking ${remotereponame} linuxgsm.sh" - fn_script_log_fail "Curl returned error: $?" + fn_script_log_fail "Curl returned error: ${exitcode}" core_exit.sh fi if [ "${remotereponame}" == "GitHub" ]; then - tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl ${nocache} --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) else - tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl ${nocache} --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh")) + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh")) fi if [ "${tmp_script_diff}" != "" ]; then fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} linuxgsm.sh" + fn_script_log "Checking ${remotereponame} script linuxgsm.sh" rm -f "${tmpdir:?}/linuxgsm.sh" fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "nochmodx" "norun" "noforcedl" "nohash" else - fn_print_ok_eol_nl - fn_script_log_pass "Checking ${remotereponame} linuxgsm.sh" + fn_print_skip_eol_nl + fn_script_log_pass "Checking ${remotereponame} script linuxgsm.sh" fi # Check gameserver.sh # Compare gameserver.sh against linuxgsm.sh in the tmp dir. # Ignoring server specific vars. -echo -en "checking ${selfname}...\c" +echo -en "checking script [ ${italic}${selfname}${default} ]\c" fn_script_log_info "Checking ${selfname}" script_diff=$(diff <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${tmpdir}/linuxgsm.sh") <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${rootdir}/${selfname}")) if [ "${script_diff}" != "" ]; then fn_print_update_eol_nl - fn_script_log_update "Checking ${selfname}" - echo -en "backup ${selfname}...\c" - fn_script_log_info "Backup ${selfname}" + fn_script_log "Checking script ${selfname}" + echo -en "backup ${selfname}\c" + fn_script_log_info "Backup script ${selfname}" if [ ! -d "${backupdir}/script" ]; then mkdir -p "${backupdir}/script" fi cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" - if [ $? != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Backup ${selfname}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "Backup ${selfname}" - echo -e "backup location ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" + fn_script_log_pass "Backup script${selfname}" + echo -e "backup location [ ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak ]" fn_script_log_pass "Backup location ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" fi - echo -en "copying ${selfname}...\c" + echo -en "copying ${selfname}" fn_script_log_info "Copying ${selfname}" cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}" sed -i "s+shortname=\"core\"+shortname=\"${shortname}\"+g" "${rootdir}/${selfname}" @@ -109,7 +113,8 @@ if [ "${script_diff}" != "" ]; then sed -i "s+githubrepo=\"LinuxGSM\"+githubrepo=\"${githubrepo}\"+g" "${rootdir}/${selfname}" sed -i "s+githubbranch=\"master\"+githubbranch=\"${githubbranch}\"+g" "${rootdir}/${selfname}" - if [ $? != "0" ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "copying ${selfname}" core_exit.sh @@ -118,72 +123,74 @@ if [ "${script_diff}" != "" ]; then fn_script_log_pass "copying ${selfname}" fi else - fn_print_ok_eol_nl + fn_print_skip_eol_nl fn_script_log_info "Checking ${selfname}" fi # Check _default.cfg. -echo -en "checking ${remotereponame} config _default.cfg...\c" +echo -en "checking ${remotereponame} config [ ${italic}_default.cfg${default} ]\c" fn_script_log_info "Checking ${remotereponame} config _default.cfg" if [ "${remotereponame}" == "GitHub" ]; then - curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null else - curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null fi -if [ $? != "0" ]; then +exitcode=$? +if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Checking ${remotereponame} config _default.cfg" - fn_script_log_fail "Curl returned error: $?" + fn_script_log_fail "Curl returned error: ${exitcode}" core_exit.sh fi if [ "${remotereponame}" == "GitHub" ]; then - config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl ${nocache} --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) else - config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl ${nocache} --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) fi if [ "${config_file_diff}" != "" ]; then fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} config _default.cfg" + fn_script_log "Checking ${remotereponame} config _default.cfg" rm -f "${configdirdefault:?}/config-lgsm/${gameservername:?}/_default.cfg" fn_fetch_file_github "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "nochmodx" "norun" "noforce" "nohash" alert="config" alert.sh else - fn_print_ok_eol_nl + fn_print_skip_eol_nl fn_script_log_pass "Checking ${remotereponame} config _default.cfg" fi # Check distro csv. ${datadir}/${distroid}-${distroversioncsv}.csv if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then - echo -en "checking ${remotereponame} config ${distroid}-${distroversioncsv}.csv...\c" + echo -en "checking ${remotereponame} config [ ${italic}${distroid}-${distroversioncsv}.csv${default} ]\c" fn_script_log_info "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" if [ "${remotereponame}" == "GitHub" ]; then - curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null else - curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null fi - if [ $? != "0" ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" - fn_script_log_fail "Curl returned error: $?" + fn_script_log_fail "Curl returned error: ${exitcode}" core_exit.sh fi if [ "${remotereponame}" == "GitHub" ]; then - config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl ${nocache} --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) + config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) else - config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl ${nocache} --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) + config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) fi if [ "${config_file_diff}" != "" ]; then fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" + fn_script_log "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" rm -f "${datadir:?}/${distroid}-${distroversioncsv}.csv" fn_fetch_file_github "${datadir}" "${distroid}-${distroversioncsv}.csv" "${datadir}" "nochmodx" "norun" "noforce" "nohash" else - fn_print_ok_eol_nl + fn_print_skip_eol_nl fn_script_log_pass "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" fi fi @@ -195,14 +202,15 @@ if [ -n "${modulesdir}" ]; then for modulefile in *; do # check if module exists in the repo and remove if missing. # commonly used if module names change. - echo -en "checking ${remotereponame} module ${modulefile}...\c" + echo -en "checking ${remotereponame} module [ ${italic}${modulefile}${default} ]\c" github_file_url_dir="lgsm/modules" if [ "${remotereponame}" == "GitHub" ]; then - curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null else - curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null fi - if [ $? != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_error_eol_nl fn_script_log_error "Checking ${remotereponame} module ${modulefile}" echo -en "removing module ${modulefile}...\c" @@ -217,19 +225,19 @@ if [ -n "${modulesdir}" ]; then else # compare file if [ "${remotereponame}" == "GitHub" ]; then - module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl ${nocache} --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}")) + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}")) else - module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl ${nocache} --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}")) + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}")) fi # results if [ "${module_file_diff}" != "" ]; then fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} module ${modulefile}" + fn_script_log "Checking ${remotereponame} module ${modulefile}" rm -rf "${modulesdir:?}/${modulefile}" fn_update_module else - fn_print_ok_eol_nl + fn_print_skip_eol_nl fn_script_log_pass "Checking ${remotereponame} module ${modulefile}" fi fi diff --git a/lgsm/modules/command_validate.sh b/lgsm/modules/command_validate.sh old mode 100644 new mode 100755 index e35749924..30c20e96e --- a/lgsm/modules/command_validate.sh +++ b/lgsm/modules/command_validate.sh @@ -11,18 +11,18 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_validate() { - fn_print_warn "Validate might overwrite some customised files" + fn_print_warn ": SteamCMD: Validate might overwrite some customised files" fn_script_log_warn "${commandaction} server: Validate might overwrite some customised files" totalseconds=3 for seconds in {3..1}; do - fn_print_warn "Validate might overwrite some customised files: ${totalseconds}" + fn_print_warn ": SteamCMD: Validate might overwrite some customised files: ${totalseconds}" totalseconds=$((totalseconds - 1)) fn_sleep_time_1 if [ "${seconds}" == "0" ]; then break fi done - fn_print_warn_nl "Validate might overwrite some customised files" + fn_print_warn_nl ": SteamCMD: Validate might overwrite some customised files" date '+%s' > "${lockdir:?}/update.lock" fn_dl_steamcmd } diff --git a/lgsm/modules/command_wipe.sh b/lgsm/modules/command_wipe.sh old mode 100644 new mode 100755 index daf9270e6..21023d17d --- a/lgsm/modules/command_wipe.sh +++ b/lgsm/modules/command_wipe.sh @@ -13,7 +13,7 @@ fn_firstcommand_set # Provides an exit code upon error. fn_wipe_exit_code() { exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl core_exit.sh else @@ -29,14 +29,14 @@ fn_wipe_files() { # Remove Map files if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]; then - echo -en "removing .map file(s)..." + fn_print "removing .map file(s)..." fn_script_log_info "Removing *.map file(s)" fn_sleep_time find "${serveridentitydir:?}" -type f -name "*.map" -printf "%f\n" >> "${lgsmlog}" find "${serveridentitydir:?}" -type f -name "*.map" -delete | tee -a "${lgsmlog}" fn_wipe_exit_code else - echo -e "no .map file(s) to remove" + fn_print_nl "no .map file(s) to remove" fn_sleep_time fn_script_log_pass "no .map file(s) to remove" fi @@ -44,14 +44,14 @@ fn_wipe_files() { # Remove Save files. if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then if [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]; then - echo -en "removing .sav file(s)..." + fn_print "removing .sav file(s)..." fn_script_log_info "Removing .sav file(s)" fn_sleep_time find "${serveridentitydir:?}" -type f -name "*.sav*" -printf "%f\n" >> "${lgsmlog}" find "${serveridentitydir:?}" -type f -name "*.sav*" -delete fn_wipe_exit_code else - echo -e "no .sav file(s) to remove" + fn_print_nl "no .sav file(s) to remove" fn_script_log_pass "no .sav file(s) to remove" fn_sleep_time fi @@ -60,14 +60,14 @@ fn_wipe_files() { # Excluding player.tokens.db for Rust+. if [ -n "${serverwipe}" ]; then if [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then - echo -en "removing .db file(s)..." + fn_print "removing .db file(s)..." fn_script_log_info "Removing .db file(s)" fn_sleep_time find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -printf "%f\n" >> "${lgsmlog}" find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -delete fn_wipe_exit_code else - echo -e "no .db file(s) to remove" + fn_print_nl "no .db file(s) to remove" fn_sleep_time fn_script_log_pass "no .db file(s) to remove" fi @@ -104,13 +104,13 @@ fn_full_wipe_warning() { fn_print_warn_nl "Server wipe will reset the map data and remove blueprint data" } -# Will change the seed if the seed is not defined by the user. +# If the seed is not defined by the user, generate a seed file. fn_wipe_random_seed() { if [ -f "${datadir}/${selfname}-seed.txt" ] && [ -n "${randomseed}" ]; then shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" seed=$(cat "${datadir}/${selfname}-seed.txt") randomseed=1 - echo -en "generating new random seed (${cyan}${seed}${default})..." + fn_print "generating new random seed (${cyan}${seed}${default})..." fn_script_log_pass "Generating new random seed (${cyan}${seed}${default})" fn_sleep_time fn_print_ok_eol_nl @@ -120,21 +120,21 @@ fn_wipe_random_seed() { # A summary of what wipe is going to do. fn_wipe_details() { fn_print_information_nl "Wipe does not remove Rust+ data." - echo -en "* Wipe map data: " + fn_print "* Wipe map data " if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then fn_print_yes_eol_nl else fn_print_no_eol_nl fi - echo -en "* Wipe blueprint data: " + fn_print "* Wipe blueprint data " if [ -n "${serverwipe}" ]; then fn_print_yes_eol_nl else fn_print_no_eol_nl fi - echo -en "* Change Procedural Map seed: " + fn_print "* Change Procedural Map seed " if [ -n "${randomseed}" ]; then fn_print_yes_eol_nl else @@ -142,10 +142,9 @@ fn_wipe_details() { fi } -fn_print_dots "" check.sh fix_rust.sh - +fn_print_dots "" # Check if there is something to wipe. if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ] || [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ] && [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then if [ -n "${serverwipe}" ]; then @@ -165,7 +164,7 @@ if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ] || [ -n "$(find fn_firstcommand_reset fn_wipe_files fn_wipe_random_seed - fn_print_complete_nl "${wipetype}" + fn_print_success_nl "${wipetype}" fn_script_log_pass "${wipetype}" alert="wipe" alert.sh @@ -175,7 +174,7 @@ if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ] || [ -n "$(find else fn_wipe_files fn_wipe_random_seed - fn_print_complete_nl "${wipetype}" + fn_print_success_nl "${wipetype}" fn_script_log_pass "${wipetype}" alert="wipe" alert.sh diff --git a/lgsm/modules/compress_unreal2_maps.sh b/lgsm/modules/compress_unreal2_maps.sh deleted file mode 100644 index 4469aca40..000000000 --- a/lgsm/modules/compress_unreal2_maps.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# LinuxGSM compress_unreal2_maps.sh module -# Author: Daniel Gibbs -# Contributors: https://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: Compresses unreal maps. - -commandname="MAP-COMPRESSOR" -commandaction="Compressing maps" -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_firstcommand_set - -check.sh -fn_print_header -echo -e "Will compress all maps in:" -echo -e "" -pwd -echo -e "" -echo -e "Compressed maps saved to:" -echo -e "" -echo -e "${compressedmapsdir}" -echo -e "" -if ! fn_prompt_yn "Start compression?" Y; then - exitcode=0 - core_exit.sh -fi -mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 -rm -rfv "${serverfiles:?}/Maps/"*.ut2.uz2 -cd "${systemdir}" || exit -for map in "${serverfiles}/Maps/"*; do - ./ucc-bin compress "${map}" --nohomedir -done -mv -fv "${serverfiles}/Maps/"*.ut2.uz2 "${compressedmapsdir}" - -core_exit.sh diff --git a/lgsm/modules/compress_unreal_maps.sh b/lgsm/modules/compress_unreal_maps.sh new file mode 100755 index 000000000..6b97e03d9 --- /dev/null +++ b/lgsm/modules/compress_unreal_maps.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# LinuxGSM compress_unreal_maps.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Compresses unreal and unreal2 resources. + +commandname="MAP-COMPRESSOR" +commandaction="Compressing Maps" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +fn_print_header +echo -e "Will compress all maps in:" +echo -e "" +pwd +echo -e "" +echo -e "Compressed maps saved to:" +echo -e "" +echo -e "${compressedmapsdir}" +echo -e "" +totalseconds=3 +for seconds in {3..1}; do + fn_print_warn "map compression starting in: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + fn_sleep_time_1 + if [ "${seconds}" == "0" ]; then + break + fi +done +fn_print_nl +mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 + +# List of extensions to compress +exts=(ut2 kfm rom u ucl upl int utx uax ukx usx unr umx umod uzx) + +# Remove old compressed files using find +for ext in "${exts[@]}"; do + mapfile -t oldfiles < <(find "${serverfiles}" -name "*.${ext}.uz2" -type f) + if [ ${#oldfiles[@]} -gt 0 ]; then + echo -e "found ${#oldfiles[@]} old compressed file(s) to remove for extension: ${ext}" + fi + for file in "${oldfiles[@]}"; do + if rm -f "$file"; then + echo -en "removing file [ ${italic}$(basename "$file")${default} ]\c" + fn_print_ok_eol_nl + else + echo -en "removing file [ ${italic}$(basename "$file")${default} ]\c" + fn_print_fail_eol_nl + fi + done +done + +cd "${systemdir}" || exit + +# Find and compress files, then move .uz2 to compressedmapsdir +for ext in "${exts[@]}"; do + # Collect all files with the current extension into an array + mapfile -t files < <(find "${serverfiles}" -name "*.${ext}" -type f) + for file in "${files[@]}"; do + echo -en "compressing file [ ${italic}$(basename "$file") -> $(basename "$file").uz2${default} ]\c" + if ! ./ucc-bin compress "${file}" --nohomedir > /dev/null 2>&1; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + + if ! mv -f "${file}.uz2" "${compressedmapsdir}" > /dev/null 2>&1; then + echo -en "moving compressed file [ ${italic}$(basename "$file").uz2 -> ${compressedmapsdir}/$(basename "$file").uz2${default} ]\c" + fn_print_fail_eol_nl + core_exit.sh + fi + done +done + +fn_print_ok_nl "Compression complete: All compressed files moved to: ${compressedmapsdir}" + +core_exit.sh diff --git a/lgsm/modules/compress_ut99_maps.sh b/lgsm/modules/compress_ut99_maps.sh deleted file mode 100644 index 23a93b3b7..000000000 --- a/lgsm/modules/compress_ut99_maps.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# LinuxGSM compress_ut99_maps.sh module -# Author: Daniel Gibbs -# Contributors: https://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: Compresses unreal maps. - -commandname="MAP-COMPRESSOR" -commandaction="Compressing maps" -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_firstcommand_set - -check.sh -fn_print_header -echo -e "Will compress all maps in:" -echo -e "" -pwd -echo -e "" -echo -e "Compressed maps saved to:" -echo -e "" -echo -e "${compressedmapsdir}" -echo -e "" -if ! fn_prompt_yn "Start compression?" Y; then - exitcode=0 - core_exit.sh -fi -mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 -rm -rfv "${serverfiles:?}/Maps/"*.unr.uz -cd "${systemdir}" || exit -for map in "${serverfiles}/Maps/"*; do - ./ucc-bin compress "${map}" --nohomedir -done -mv -fv "${serverfiles}/Maps/"*.unr.uz "${compressedmapsdir}" - -core_exit.sh diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh old mode 100644 new mode 100755 index 68d0cf576..c3194a915 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -20,6 +20,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_dl_steamcmd() { + remotelocation="SteamCMD" fn_print_start_nl "${remotelocation}" fn_script_log_info "${commandaction} ${selfname}: ${remotelocation}" if [ -n "${branch}" ]; then @@ -45,6 +46,18 @@ fn_dl_steamcmd() { validate="validate" fi + # Wrap steamcmdcommand as a single-element array to avoid word-splitting + # on paths/commands that should not be tokenised. + steamcmdcommandarray=("${steamcmdcommand}") + unbuffercommand=() + if [ -n "${unbuffer}" ]; then + unbuffercommand=("${unbuffer}") + fi + validateparam=() + if [ -n "${validate}" ]; then + validateparam=("${validate}") + fi + # To do error checking for SteamCMD the output of steamcmd will be saved to a log. steamcmdlog="${lgsmlogdir}/${selfname}-steamcmd.log" @@ -53,36 +66,62 @@ fn_dl_steamcmd() { rm -f "${steamcmdlog:?}" fi counter=0 - while [ "${counter}" == "0" ] || [ "${exitcode}" != "0" ]; do + while [ "${counter}" -eq 0 ] || [ "${exitcode}" -ne 0 ]; do counter=$((counter + 1)) # Select SteamCMD parameters # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands. if [ "${appid}" == "90" ]; then # If using a specific branch. if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then - ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" elif [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" else - ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" fi # Force Windows Platform type. elif [ "${steamcmdforcewindows}" == "yes" ]; then + # If a base app is required, install it first. + if [ -n "${baseappid}" ]; then + if [ -z "${supportdir}" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: baseappid is set but supportdir is not defined" + fn_script_log_fail "${commandaction} ${selfname}: baseappid is set but supportdir is not defined" + core_exit.sh + fi + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + exitcode="${PIPESTATUS[0]}" + if [ "${exitcode}" -ne 0 ]; then + continue + fi + fi if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then - ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" elif [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" else - ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" fi # All other servers. else + # If a base app is required, install it first. + if [ -n "${baseappid}" ]; then + if [ -z "${supportdir}" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: baseappid is set but supportdir is not defined" + fn_script_log_fail "${commandaction} ${selfname}: baseappid is set but supportdir is not defined" + core_exit.sh + fi + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + exitcode="${PIPESTATUS[0]}" + if [ "${exitcode}" -ne 0 ]; then + continue + fi + fi if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then - ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" elif [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" else - ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" fi fi @@ -100,6 +139,12 @@ fn_dl_steamcmd() { fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" core_exit.sh + # Invalid platform for app/update request. + elif [ -n "$(grep -i "Invalid platform" "${steamcmdlog}" | tail -1)" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Invalid platform for AppID ${appid}" + fn_print_nl "Check steamcmdforcewindows setting and system architecture (x86_64 required for most servers)" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Invalid platform for AppID ${appid}" + core_exit.sh # Need tp purchase game. elif [ -n "$(grep "No subscription" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" @@ -127,16 +172,19 @@ fn_dl_steamcmd() { elif [ -n "$(grep "0x626" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x626" "${steamcmdlog}" | tail -1)" ]; then fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Missing update files" fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Missing update files" + elif [ -n "$(grep "0x6A6" "${steamcmdlog}" | tail -1)" ]; then + fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Corrupt update files" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Corrupt update files" else - fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" - echo -en "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error" - fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" + fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occurred" + fn_print_nl "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Unknown error occurred" fi - elif [ "${exitcode}" != 0 ]; then + elif [ "${exitcode}" -ne 0 ]; then fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Exit code: ${exitcode}" fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Exit code: ${exitcode}" else - fn_print_complete_nl "${commandaction} ${selfname}: ${remotelocation}" + fn_print_success_nl "${commandaction} ${selfname}: ${remotelocation}" fn_script_log_pass "${commandaction} ${selfname}: ${remotelocation}" fi @@ -150,16 +198,16 @@ fn_dl_steamcmd() { # Emptys contents of the LinuxGSM tmpdir. fn_clear_tmp() { - echo -en "clearing LinuxGSM tmp directory..." + echo -en "clearing tmp directory [ ${italic}${tmpdir}${default} ]" if [ -d "${tmpdir}" ]; then rm -rf "${tmpdir:?}/"* - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_error_eol_nl - fn_script_log_error "clearing LinuxGSM tmp directory" + fn_script_log_error "clearing tmp directory ${tmpdir}" else fn_print_ok_eol_nl - fn_script_log_pass "clearing LinuxGSM tmp directory" + fn_script_log_pass "clearing tmp directory ${tmpdir}" fi fi } @@ -184,11 +232,11 @@ fn_dl_hash() { hashbin="sha512sum" hashtype="SHA512" else - fn_script_log_error "hash lengh not known for hash type" - fn_print_error_nl "hash lengh not known for hash type" + fn_script_log_error "hash length not known for hash type" + fn_print_error_nl "hash length not known for hash type" core_exit.sh fi - echo -en "verifying ${local_filename} with ${hashtype}..." + echo -en "verifying ${local_filename} with ${hashtype}" fn_sleep_time hashsumcmd=$(${hashbin} "${local_filedir}/${local_filename}" | awk '{print $1}') if [ "${hashsumcmd}" != "${hash}" ]; then @@ -251,16 +299,16 @@ fn_dl_extract() { fi elif [ "${mime}" == "application/zip" ]; then if [ -n "${extractsrc}" ]; then - temp_extractdir="${tmpdir}/Xonotic" + temp_extractdir="${tmpdir}/${extractsrc}" extractcmd=$(unzip -qo "${local_filedir}/${local_filename}" "${extractsrc}/*" -d "${temp_extractdir}") - find "${temp_extractdir}/${extractsrc}" -mindepth 1 -maxdepth 1 -exec mv -t "${extractdest}" {} + + cp -a "${temp_extractdir}/${extractsrc}/." "${extractdest}/" rm -rf "${temp_extractdir}" else extractcmd=$(unzip -qo -d "${extractdest}" "${local_filedir}/${local_filename}") fi fi - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Extracting ${local_filename}" if [ -f "${lgsmlog}" ]; then @@ -277,11 +325,11 @@ fn_dl_extract() { # Trap to remove file download if canceled before completed. fn_fetch_trap() { echo -e "" - echo -en "downloading ${local_filename}..." + echo -en "downloading ${local_filename}" fn_print_canceled_eol_nl fn_script_log_info "Downloading ${local_filename}...CANCELED" rm -f "${local_filedir:?}/${local_filename}" - echo -en "downloading ${local_filename}..." + echo -en "downloading ${local_filename}" fn_print_removed_eol_nl fn_script_log_info "Downloading ${local_filename}...REMOVED" core_exit.sh @@ -313,12 +361,12 @@ fn_check_file() { fileurl_name="${remote_fileurl_backup_name}" fi counter=$((counter + 1)) - echo -en "checking ${fileurl_name} ${remote_filename}...\c" + echo -e "checking ${fileurl_name} ${remote_filename}\c" curlcmd=$(curl --output /dev/null --silent --head --fail "${fileurl}" 2>&1) - local exitcode=$? + exitcode=$? # On first try will error. On second try will fail. - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then if [ ${counter} -ge 2 ]; then fn_print_fail_eol_nl if [ -f "${lgsmlog}" ]; then @@ -379,6 +427,7 @@ fn_fetch_file() { counter=1 remote_fileurls_array=(remote_fileurl) fi + for remote_fileurl_array in "${remote_fileurls_array[@]}"; do if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then fileurl="${remote_fileurl}" @@ -399,15 +448,15 @@ fn_fetch_file() { local exitcode="" large_files=("bz2" "gz" "zip" "jar" "xz") if grep -qE "(^|\s)${local_filename##*.}(\s|$)" <<< "${large_files[@]}"; then - echo -en "downloading ${local_filename}..." + echo -e "downloading file [ ${italic}${local_filename}${default} ]" fn_sleep_time - echo -en "\033[1K" "${curlcmd[@]}" --progress-bar "${fileurl}" 2>&1 - exitcode="$?" + exitcode=$? + echo -en "downloading file [ ${italic}${local_filename}${default} ]" else - echo -en "fetching ${fileurl_name} ${local_filename}...\c" + echo -en "fetching ${fileurl_name} [ ${italic}${local_filename}${default} ]\c" "${curlcmd[@]}" --silent --show-error "${fileurl}" 2>&1 - exitcode="$?" + exitcode=$? fi # Download will fail if downloads a html file. @@ -419,7 +468,7 @@ fn_fetch_file() { fi # On first try will error. On second try will fail. - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then if [ ${counter} -ge 2 ]; then fn_print_fail_eol_nl if [ -f "${lgsmlog}" ]; then diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh old mode 100644 new mode 100755 index fd7645462..1dd6e2f46 --- a/lgsm/modules/core_exit.sh +++ b/lgsm/modules/core_exit.sh @@ -13,8 +13,8 @@ fn_exit_dev_debug() { echo -e "${moduleselfname} exiting with code: ${exitcode}" if [ -f "${rootdir}/dev-debug.log" ]; then grep -a "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" - elif [ -f "${lgsmlogdir}/dev-debug.log" ]; then - grep -a "modulefile=" "${lgsmlogdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" + elif [ -f "${logdir}/dev-debug.log" ]; then + grep -a "modulefile=" "${logdir}/dev-debug.log" | sed 's/modulefile=//g' > "${logdir}/dev-debug-module-order.log" fi fi } @@ -27,14 +27,14 @@ fi if [ "${exitbypass}" ]; then unset exitbypass -elif [ "${exitcode}" != "0" ]; then +elif [ "${exitcode}" -ne 0 ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" - if [ "${exitcode}" == "1" ]; then + if [ "${exitcode}" -eq 1 ]; then fn_script_log_fail "${moduleselfname} exiting with code: ${exitcode}" - elif [ "${exitcode}" == "2" ]; then + elif [ "${exitcode}" -eq 2 ]; then fn_script_log_error "${moduleselfname} exiting with code: ${exitcode}" - elif [ "${exitcode}" == "3" ]; then + elif [ "${exitcode}" -eq 3 ]; then fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" else # if exit code is not set assume error. @@ -45,7 +45,7 @@ elif [ "${exitcode}" != "0" ]; then # remove trap. trap - INT exit "${exitcode}" -elif [ "${exitcode}" ] && [ "${exitcode}" == "0" ]; then +elif [ "${exitcode}" ] && [ "${exitcode}" -eq 0 ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" fn_script_log_pass "${moduleselfname} exiting with code: ${exitcode}" diff --git a/lgsm/modules/core_getopt.sh b/lgsm/modules/core_getopt.sh old mode 100644 new mode 100755 index 688dcdc9c..ad09bf1df --- a/lgsm/modules/core_getopt.sh +++ b/lgsm/modules/core_getopt.sh @@ -42,8 +42,7 @@ cmd_change_password=("pw;change-password" "command_ts3_server_pass.sh" "Change T cmd_install_default_resources=("ir;install-default-resources" "command_install_resources_mta.sh" "Install the MTA default resources.") cmd_fullwipe=("fw;full-wipe;wa;wipeall" "serverwipe=1; command_wipe.sh" "Reset the map and remove blueprint data.") cmd_mapwipe=("mw;map-wipe;w;wipe;wi" "mapwipe=1; command_wipe.sh" "Reset the map and keep blueprint data.") -cmd_map_compressor_u99=("mc;map-compressor" "compress_ut99_maps.sh" "Compresses all ${gamename} server maps.") -cmd_map_compressor_u2=("mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps.") +cmd_map_compressor_unreal=("mc;map-compressor" "compress_unreal_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.") @@ -56,6 +55,7 @@ cmd_dev_detect_deps=("dd;detect-deps" "command_dev_detect_deps.sh" "Detect requi cmd_dev_detect_glibc=("dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc.") cmd_dev_detect_ldd=("dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies.") cmd_dev_query_raw=("qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery.") +cmd_dev_ui=("ui;ui" "command_dev_ui.sh" "Assist with UI development.") cmd_dev_clear_modules=("cm;clear-modules" "command_dev_clear_modules.sh" "Delete the contents of the modules dir.") ### Set specific opt here. @@ -66,7 +66,7 @@ currentopt=("${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monito currentopt+=("${cmd_update_linuxgsm[@]}") # Exclude noupdate games here. -if [ "${shortname}" == "jk2" ] || [ "${engine}" != "idtech3" ]; then +if [ "${shortname}" == "jk2" ] || [ "${shortname}" == "etl" ] || [ "${engine}" != "idtech3" ]; then if [ "${shortname}" != "bf1942" ] && [ "${shortname}" != "bfv" ] && [ "${engine}" != "idtech2" ] && [ "${engine}" != "iw2.0" ] && [ "${engine}" != "iw3.0" ] && [ "${engine}" != "quake" ] && [ "${shortname}" != "samp" ] && [ "${shortname}" != "ut2k4" ]; then currentopt+=("${cmd_update[@]}" "${cmd_check_update[@]}") # force update for SteamCMD or Multi Theft Auto only. @@ -95,7 +95,7 @@ fi ## Game server exclusive commands. # FastDL command. -if [ "${engine}" == "source" ]; then +if [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then currentopt+=("${cmd_fastdl[@]}") fi @@ -112,13 +112,13 @@ fi # Unreal exclusive. if [ "${engine}" == "unreal2" ]; then if [ "${shortname}" == "ut2k4" ]; then - currentopt+=("${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}") + currentopt+=("${cmd_install_cdkey[@]}" "${cmd_map_compressor_unreal[@]}") else - currentopt+=("${cmd_map_compressor_u2[@]}") + currentopt+=("${cmd_map_compressor_unreal[@]}") fi fi if [ "${engine}" == "unreal" ]; then - currentopt+=("${cmd_map_compressor_u99[@]}") + currentopt+=("${cmd_map_compressor_unreal[@]}") fi # DST exclusive. @@ -147,7 +147,7 @@ currentopt+=("${cmd_install[@]}" "${cmd_auto_install[@]}") ## Developer commands. currentopt+=("${cmd_dev_debug[@]}") if [ -f ".dev-debug" ]; then - currentopt+=("${cmd_dev_parse_game_details[@]}" "${cmd_dev_parse_distro_details[@]}" "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_modules[@]}") + currentopt+=("${cmd_dev_parse_game_details[@]}" "${cmd_dev_parse_distro_details[@]}" "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_ui[@]}" "${cmd_dev_clear_modules[@]}") fi ## Sponsor. @@ -165,19 +165,19 @@ done # Shows LinuxGSM usage. fn_opt_usage() { - echo -e "Usage: $0 [option]" - echo -e "" - echo -e "LinuxGSM - ${gamename} - Version ${version}" - echo -e "https://linuxgsm.com/${gameservername}" - echo -e "" - echo -e "${lightyellow}Commands${default}" + fn_print_nl "Usage: $0 [option]" + fn_print_nl "" + fn_print_nl "LinuxGSM - ${gamename} - Version ${version}" + fn_print_nl "https://linuxgsm.com/${gameservername}" + fn_print_nl "" + fn_print_nl "${bold}${lightyellow}Commands${default}" # Display available commands. index="0" { for ((index = "0"; index < ${#currentopt[@]}; index += 3)); do # Hide developer commands. if [ "${currentopt[index + 2]}" != "DEVCOMMAND" ]; then - echo -e "${cyan}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index + 2]}" + fn_print_nl "${cyan}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index + 2]}" fi done } | column -s $'\t' -t diff --git a/lgsm/modules/core_github.sh b/lgsm/modules/core_github.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/core_legacy.sh b/lgsm/modules/core_legacy.sh old mode 100644 new mode 100755 index 4c9a55c39..55c2172d4 --- a/lgsm/modules/core_legacy.sh +++ b/lgsm/modules/core_legacy.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Code for backwards compatability with older versions of LinuxGSM. +# Description: Code for backwards compatibility with older versions of LinuxGSM. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" @@ -35,6 +35,12 @@ if [ -n "${autosaveinterval}" ]; then saveinterval="${autosaveinterval}" fi +if [ "${shortname}" == "st" ]; then + if [ -n "${worldname}" ]; then + worldsave="${worldname}" + fi +fi + # Added as part of migrating functions dir to modules dir. # Will remove functions dir if files in modules dir older than 14 days functionsdir="${lgsmdir}/modules" diff --git a/lgsm/modules/core_logs.sh b/lgsm/modules/core_logs.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/core_messages.sh b/lgsm/modules/core_messages.sh old mode 100644 new mode 100755 index 80ef293d8..da5fd43e3 --- a/lgsm/modules/core_messages.sh +++ b/lgsm/modules/core_messages.sh @@ -34,6 +34,14 @@ fn_ansi_loader() { # erase to end of line. creeol+="\033[K" fi + # carriage return & erase to end of line. + creeol="\r\033[K" + + bold="\e[1m" + dim="\e[2m" + italic="\e[3m" + underline="\e[4m" + reverse="\e[7m" } fn_sleep_time() { @@ -71,216 +79,141 @@ fn_script_log() { ## Feb 28 14:56:58 ut99-server: Monitor: PASS: fn_script_log_pass() { - if [ -d "${lgsmlogdir}" ]; then - - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: PASS: ${1}" >> "${lgsmlog}" - else - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: PASS: ${1}" >> "${lgsmlog}" - fi - fi + fn_script_log "PASS: ${1}" exitcode=0 } ## Feb 28 14:56:58 ut99-server: Monitor: FATAL: fn_script_log_fail() { - if [ -d "${lgsmlogdir}" ]; then - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: FATAL: ${1}" >> "${lgsmlog}" - else - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: FATAL: ${1}" >> "${lgsmlog}" - fi - fi + fn_script_log "FAIL: ${1}" exitcode=1 } ## Feb 28 14:56:58 ut99-server: Monitor: ERROR: fn_script_log_error() { - if [ -d "${lgsmlogdir}" ]; then - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ERROR: ${1}" >> "${lgsmlog}" - else - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ERROR: ${1}" >> "${lgsmlog}" - fi - fi + fn_script_log "ERROR: ${1}" exitcode=2 } ## Feb 28 14:56:58 ut99-server: Monitor: WARN: fn_script_log_warn() { - if [ -d "${lgsmlogdir}" ]; then - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: WARN: ${1}" >> "${lgsmlog}" - else - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: WARN: ${1}" >> "${lgsmlog}" - fi - fi + fn_script_log "WARN: ${1}" exitcode=3 } ## Feb 28 14:56:58 ut99-server: Monitor: INFO: fn_script_log_info() { - if [ -d "${lgsmlogdir}" ]; then - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: INFO: ${1}" >> "${lgsmlog}" - else - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: INFO: ${1}" >> "${lgsmlog}" - fi - fi -} - -## Feb 28 14:56:58 ut99-server: Monitor: UPDATE: -fn_script_log_update() { - if [ -d "${lgsmlogdir}" ]; then - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: UPDATE: ${1}" >> "${lgsmlog}" - else - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: UPDATE: ${1}" >> "${lgsmlog}" - fi - fi + fn_script_log "INFO: ${1}" } # On-Screen - Automated functions ################################## -# [ .... ] -fn_print_dots() { +fn_print() { + echo -en "$*${default}" +} + +fn_print_nl() { + echo -e "$*${default}" +} + +# Helper function to print messages with a specific format and color +fn_print_message() { + local type="$1" + local color="$2" + local message="$3" if [ "${commandaction}" ]; then - echo -en "${creeol}[ .... ] ${commandaction} ${selfname}: $*" + echo -en "${bold}${creeol}[${color} ${type} ${default}]${default} ${commandaction} ${selfname}: ${message}${default}" else - echo -en "${creeol}[ .... ] $*" + echo -en "${bold}${cree}[${color} ${type} ${default}]${default} ${message}${default}" fi - fn_sleep_time_05 + fn_sleep_time } -fn_print_dots_nl() { +fn_print_message_nl() { + local type="$1" + local color="$2" + local message="$3" if [ "${commandaction}" ]; then - echo -e "${creeol}[ .... ] ${commandaction} ${selfname}: $*" + echo -e "${bold}${creeol}[${color} ${type} ${default}]${default} ${commandaction} ${selfname}: ${message}${default}" else - echo -e "${creeol}[ .... ] $*" + echo -e "${bold}${creeol}[${color} ${type} ${default}]${default} ${message}${default}" fi + fn_sleep_time +} + +# [ .... ] +fn_print_dots() { + fn_print_message "...." "${default}" "$*" + fn_sleep_time_05 +} + +fn_print_dots_nl() { + fn_print_message_nl "...." "${default}" "$*" fn_sleep_time_05 - echo -en "\n" } # [ OK ] fn_print_ok() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${green} OK ${default}] $*" - fi - fn_sleep_time + fn_print_message " OK " "${green}" "$*" } fn_print_ok_nl() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${green} OK ${default}] $*" - fi - fn_sleep_time - echo -en "\n" + fn_print_message_nl " OK " "${green}" "$*" } # [ FAIL ] fn_print_fail() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${red} FAIL ${default}] $*" - fi - fn_sleep_time + fn_print_message "FAIL" "${red}" "$*" } fn_print_fail_nl() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${red} FAIL ${default}] $*" - fi - fn_sleep_time - echo -en "\n" + fn_print_message_nl "FAIL" "${red}" "$*" } # [ ERROR ] fn_print_error() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${red} ERROR ${default}] $*" - fi - fn_sleep_time + fn_print_message "ERROR" "${red}" "$*" } fn_print_error_nl() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${red} ERROR ${default}] $*" - fi - fn_sleep_time - echo -en "\n" + fn_print_message_nl "ERROR" "${red}" "$*" } # [ WARN ] fn_print_warn() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${lightyellow} WARN ${default}] $*" - fi - fn_sleep_time + fn_print_message "WARN" "${lightyellow}" "$*" } fn_print_warn_nl() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${lightyellow} WARN ${default}] $*" - fi - fn_sleep_time - echo -en "\n" + fn_print_message_nl "WARN" "${lightyellow}" "$*" } # [ INFO ] fn_print_info() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${cyan} INFO ${default}] $*" - fi - fn_sleep_time + fn_print_message "INFO" "${cyan}" "$*" } fn_print_info_nl() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${cyan} INFO ${default}] $*" - fi - fn_sleep_time - echo -en "\n" + fn_print_message_nl "INFO" "${cyan}" "$*" +} + +# [ SKIP ] +fn_print_skip() { + fn_print_message "SKIP" "${cyan}" "$*" +} + +fn_print_skip_nl() { + fn_print_message_nl "SKIP" "${cyan}" "$*" } # [ START ] fn_print_start() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${lightgreen} START ${default}] $*" - fi - fn_sleep_time + fn_print_message "START" "${lightgreen}" "$*" } fn_print_start_nl() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${lightgreen} START ${default}] $*" - fi - fn_sleep_time - echo -en "\n" + fn_print_message_nl "START" "${lightgreen}" "$*" } # On-Screen - Interactive messages @@ -304,63 +237,75 @@ fn_print_header() { fn_messages_separator } -# Complete! -fn_print_complete() { - echo -en "${green}Complete!${default} $*" +# Success! +fn_print_success() { + echo -en "${green}Success!${default} $*${default}" fn_sleep_time } -fn_print_complete_nl() { - echo -e "${green}Complete!${default} $*" +fn_print_success_nl() { + echo -e "${green}Success!${default} $*${default}" fn_sleep_time } # Failure! fn_print_failure() { - echo -en "${red}Failure!${default} $*" + echo -en "${red}Failure!${default} $*${default}" fn_sleep_time } fn_print_failure_nl() { - echo -e "${red}Failure!${default} $*" + echo -e "${red}Failure!${default} $*${default}" fn_sleep_time } # Error! fn_print_error2() { - echo -en "${red}Error!${default} $*" + echo -en "${red}Error!${default} $*${default}" fn_sleep_time } fn_print_error2_nl() { - echo -e "${red}Error!${default} $*" + echo -e "${red}Error!${default} $*${default}" fn_sleep_time } # Warning! fn_print_warning() { - echo -en "${lightyellow}Warning!${default} $*" + echo -en "${lightyellow}Warning!${default} $*${default}" fn_sleep_time } fn_print_warning_nl() { - echo -e "${lightyellow}Warning!${default} $*" + echo -e "${lightyellow}Warning!${default} $*${default}" fn_sleep_time } # Information! fn_print_information() { - echo -en "${cyan}Information!${default} $*" + echo -en "${cyan}Information!${default} $*${default}" fn_sleep_time } fn_print_information_nl() { - echo -e "${cyan}Information!${default} $*" + echo -e "${cyan}Information!${default} $*${default}" + fn_sleep_time +} + +# Skip! +fn_print_skip2() { + echo -en "${cyan}Skip!${default} $*${default}" + fn_sleep_time +} + +fn_print_skip2_nl() { + echo -e "${cyan}Skip!${default} $*${default}" fn_sleep_time } # Y/N Prompt fn_prompt_yn() { + echo -e "" local prompt="$1" local initial="$2" @@ -400,155 +345,166 @@ fn_prompt_message() { # YES fn_print_yes_eol() { - echo -en "${cyan}YES${default}" + echo -en " ... ${cyan}YES${default}" fn_sleep_time } fn_print_yes_eol_nl() { - echo -e "${cyan}YES${default}" + echo -e " ... ${cyan}YES${default}" fn_sleep_time } # NO fn_print_no_eol() { - echo -en "${red}NO${default}" + echo -en " ... ${red}NO${default}" fn_sleep_time } fn_print_no_eol_nl() { - echo -e "${red}NO${default}" + echo -e " ... ${red}NO${default}" fn_sleep_time } # OK fn_print_ok_eol() { - echo -en "${green}OK${default}" + echo -en " ... ${green}OK${default}" fn_sleep_time } fn_print_ok_eol_nl() { - echo -e "${green}OK${default}" + echo -e " ... ${green}OK${default}" fn_sleep_time } # FAIL fn_print_fail_eol() { - echo -en "${red}FAIL${default}" + echo -en " ... ${red}FAIL${default}" fn_sleep_time } fn_print_fail_eol_nl() { - echo -e "${red}FAIL${default}" + echo -e " ... ${red}FAIL${default}" fn_sleep_time } # ERROR fn_print_error_eol() { - echo -en "${red}ERROR${default}" + echo -en " ... ${red}ERROR${default}" fn_sleep_time } fn_print_error_eol_nl() { - echo -e "${red}ERROR${default}" + echo -e " ... ${red}ERROR${default}" fn_sleep_time } # WAIT fn_print_wait_eol() { - echo -en "${cyan}WAIT${default}" + echo -en " ... ${cyan}WAIT${default}" fn_sleep_time } fn_print_wait_eol_nl() { - echo -e "${cyan}WAIT${default}" + echo -e " ... ${cyan}WAIT${default}" fn_sleep_time } # WARN fn_print_warn_eol() { - echo -en "${lightyellow}WARN${default}" + echo -en " ... ${lightyellow}WARN${default}" fn_sleep_time } fn_print_warn_eol_nl() { - echo -e "${lightyellow}WARN${default}" + echo -e " ... ${lightyellow}WARN${default}" fn_sleep_time } # INFO fn_print_info_eol() { - echo -en "${cyan}INFO${default}" + echo -en " ... ${cyan}INFO${default}" fn_sleep_time } fn_print_info_eol_nl() { - echo -e "${cyan}INFO${default}" + echo -e " ... ${cyan}INFO${default}" fn_sleep_time } # QUERYING fn_print_querying_eol() { - echo -en "${cyan}QUERYING${default}" + echo -en " ... ${cyan}QUERYING${default}" fn_sleep_time_1 } fn_print_querying_eol_nl() { - echo -e "${cyan}QUERYING${default}" + echo -e " ... ${cyan}QUERYING${default}" fn_sleep_time_1 } # CHECKING fn_print_checking_eol() { - echo -en "${cyan}CHECKING${default}" + echo -en " ... ${cyan}CHECKING${default}" fn_sleep_time_1 } fn_print_checking_eol_nl() { - echo -e "${cyan}CHECKING${default}" + echo -e " ... ${cyan}CHECKING${default}" fn_sleep_time_1 } # DELAY fn_print_delay_eol() { - echo -en "${green}DELAY${default}" + echo -en " ... ${green}DELAY${default}" fn_sleep_time_1 } fn_print_delay_eol_nl() { - echo -e "${green}DELAY${default}" + echo -e " ... ${green}DELAY${default}" fn_sleep_time_1 } # CANCELED fn_print_canceled_eol() { - echo -en "${lightyellow}CANCELED${default}" + echo -en " ... ${lightyellow}CANCELED${default}" fn_sleep_time_1 } fn_print_canceled_eol_nl() { - echo -e "${lightyellow}CANCELED${default}" + echo -e " ... ${lightyellow}CANCELED${default}" fn_sleep_time_1 } # REMOVED fn_print_removed_eol() { - echo -en "${red}REMOVED${default}" + echo -en " ... ${red}REMOVED${default}" fn_sleep_time_1 } fn_print_removed_eol_nl() { - echo -e "${red}REMOVED${default}" + echo -e " ... ${red}REMOVED${default}" fn_sleep_time_1 } # UPDATE fn_print_update_eol() { - echo -en "${cyan}UPDATE${default}" + echo -en " ... ${lightblue}UPDATE${default}" fn_sleep_time } fn_print_update_eol_nl() { - echo -e "${cyan}UPDATE${default}" + echo -e " ... ${lightblue}UPDATE${default}" + fn_sleep_time +} + +# SKIP +fn_print_skip_eol() { + echo -en " ... ${cyan}SKIP${default}" + fn_sleep_time +} + +fn_print_skip_eol_nl() { + echo -e " ... ${cyan}SKIP${default}" fn_sleep_time } @@ -604,7 +560,7 @@ fn_print_restart_warning() { } # Functions below are used to ensure that logs and UI correctly reflect the command it is actually running. -# Useful when a command has to call upon another command causing the other command to overrite commandname variables +# Useful when a command has to call upon another command causing the other command to overwrite commandname variables # Used to remember the command that ran first. fn_firstcommand_set() { diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh old mode 100644 new mode 100755 index e4fa35b32..ce1a6f6d4 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v24.3.2" +modulesversion="v26.1.0" # Core @@ -21,37 +21,42 @@ core_dl.sh() { fi } -core_messages.sh() { +core_exit.sh() { modulefile="${FUNCNAME[0]}" - if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then - fn_fetch_core_dl "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" - else - fn_bootstrap_fetch_file_github "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fn_fetch_module + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + echo "fn_fetch_module failed, using fn_bootstrap_fetch_module instead." + fn_bootstrap_fetch_module fi } -core_legacy.sh() { +core_getopt.sh() { modulefile="${FUNCNAME[0]}" - if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then - fn_fetch_core_dl "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" - else - fn_bootstrap_fetch_file_github "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" - fi + fn_fetch_module } -core_exit.sh() { +core_github.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -core_getopt.sh() { +core_legacy.sh() { modulefile="${FUNCNAME[0]}" - fn_fetch_module + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi } -core_trap.sh() { +core_messages.sh() { modulefile="${FUNCNAME[0]}" - fn_fetch_module + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi } core_steamcmd.sh() { @@ -59,7 +64,7 @@ core_steamcmd.sh() { fn_fetch_module } -core_github.sh() { +core_trap.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -86,87 +91,87 @@ command_details.sh() { fn_fetch_module } -command_sponsor.sh() { +command_fastdl.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_postdetails.sh() { +command_install.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_test_alert.sh() { +command_install_resources_mta.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_monitor.sh() { +command_mods_install.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_start.sh() { +command_mods_remove.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_stop.sh() { +command_mods_update.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_validate.sh() { +command_monitor.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_install.sh() { +command_postdetails.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_install_resources_mta.sh() { +command_restart.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -install_squad_license.sh() { +command_send.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_mods_install.sh() { +command_skeleton.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_mods_update.sh() { +command_sponsor.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_mods_remove.sh() { +command_start.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_fastdl.sh() { +command_stop.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_ts3_server_pass.sh() { +command_test_alert.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_restart.sh() { +command_ts3_server_pass.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_skeleton.sh() { +command_validate.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -176,7 +181,7 @@ command_wipe.sh() { fn_fetch_module } -command_send.sh() { +install_squad_license.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -270,19 +275,14 @@ compress_unreal2_maps.sh() { fn_fetch_module } -compress_ut99_maps.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - # Mods -mods_list.sh() { +mods_core.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -mods_core.sh() { +mods_list.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -299,27 +299,27 @@ command_dev_debug.sh() { fn_fetch_module } -command_dev_parse_game_details.sh() { +command_dev_detect_deps.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_dev_parse_distro_details.sh() { +command_dev_detect_glibc.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_dev_detect_deps.sh() { +command_dev_detect_ldd.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_dev_detect_glibc.sh() { +command_dev_parse_distro_details.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_dev_detect_ldd.sh() { +command_dev_parse_game_details.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -329,6 +329,11 @@ command_dev_query_raw.sh() { fn_fetch_module } +command_dev_ui.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + # Fix fix.sh() { @@ -341,27 +346,27 @@ fix_ark.sh() { fn_fetch_module } -fix_av.sh() { +fix_arma3.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_arma3.sh() { +fix_armar.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_armar.sh() { +fix_av.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_bt.sh() { +fix_bo.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_bo.sh() { +fix_bt.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -441,67 +446,67 @@ fix_rw.sh() { fn_fetch_module } -fix_sfc.sh() { +fix_samp.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_sm.sh() { +fix_sdtd.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_st.sh() { +fix_sfc.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_steamcmd.sh() { +fix_sm.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_terraria.sh() { +fix_sof2.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_tf2.sh() { +fix_squad.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_ut3.sh() { +fix_st.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_rust.sh() { +fix_steamcmd.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_samp.sh() { +fix_terraria.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_sdtd.sh() { +fix_tf2.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_sof2.sh() { +fix_ts3.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_squad.sh() { +fix_unt.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_ts3.sh() { +fix_ut.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -511,12 +516,7 @@ fix_ut2k4.sh() { fn_fetch_module } -fix_ut.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_unt.sh() { +fix_ut3.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -580,27 +580,27 @@ alert_email.sh() { fn_fetch_module } -alert_ifttt.sh() { +alert_gotify.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -alert_pushbullet.sh() { +alert_ifttt.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -alert_pushover.sh() { +alert_ntfy.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -alert_gotify.sh() { +alert_pushbullet.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -alert_telegram.sh() { +alert_pushover.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -614,6 +614,12 @@ alert_slack.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } + +alert_telegram.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + # Logs core_logs.sh() { @@ -629,8 +635,12 @@ query_gamedig.sh() { } # Update +command_check_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} -command_update_modules.sh() { +command_update.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -640,47 +650,47 @@ command_update_linuxgsm.sh() { fn_fetch_module } -command_update.sh() { +command_update_modules.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_check_update.sh() { +fn_update_modules.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_ts3.sh() { +update_etl.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_mc.sh() { +update_fctr.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_mcb.sh() { +update_jk2.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_pmc.sh() { +update_mc.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_mta.sh() { +update_mcb.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_fctr.sh() { +update_mta.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_jk2.sh() { +update_pmc.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -690,7 +700,7 @@ update_steamcmd.sh() { fn_fetch_module } -update_vints.sh() { +update_ts3.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -700,12 +710,17 @@ update_ut99.sh() { fn_fetch_module } -update_xnt.sh() { +update_bb.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fn_update_modules.sh() { +update_vints.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_xnt.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -713,6 +728,10 @@ fn_update_modules.sh() { # ## Installer modules # +check_gamedig.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} fn_autoinstall() { autoinstall=1 @@ -729,32 +748,32 @@ install_config.sh() { fn_fetch_module } -install_factorio_save.sh() { +install_dl_ut2k4.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -check_gamedig.sh() { +install_dst_token.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -install_dst_token.sh() { +install_eula.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -install_eula.sh() { +install_factorio_save.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -install_gsquery.sh() { +install_gslt.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -install_gslt.sh() { +install_gsquery.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -778,6 +797,7 @@ install_server_dir.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } + install_server_files.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module @@ -808,11 +828,6 @@ install_ut2k4.sh() { fn_fetch_module } -install_dl_ut2k4.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - install_ut2k4_key.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh old mode 100644 new mode 100755 index e08c921dd..463a1f7da --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -23,7 +23,7 @@ fn_check_steamcmd_user() { # Checks if steamuser is setup. if [ "${steamuser}" == "username" ]; then fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}" - echo -e " * Change steamuser=\"username\" to a valid steam login." + fn_print_nl " * Change steamuser=\"username\" to a valid steam login." if [ -d "${lgsmlogdir}" ]; then fn_script_log_fail "Steam login not set. Update steamuser in ${configdirserver}" fi @@ -44,15 +44,16 @@ fn_check_steamcmd() { # Only install if steamcmd package is missing or steamcmd dir is missing. if [ ! -f "${steamcmddir}/steamcmd.sh" ] && [ -z "$(command -v steamcmd 2> /dev/null)" ]; then if [ "${commandname}" == "INSTALL" ]; then + fn_print_nl "install SteamCMD" fn_install_steamcmd else - fn_print_warn_nl "SteamCMD is missing" - fn_script_log_warn "SteamCMD is missing" + fn_print_warn_nl "SteamCMD is not installed" + fn_script_log_warn "SteamCMD is not installed" fn_install_steamcmd fi elif [ "${commandname}" == "INSTALL" ]; then - fn_print_information "SteamCMD is already installed..." - fn_print_ok_eol_nl + fn_print "install SteamCMD" + fn_print_skip_eol_nl fi } @@ -128,7 +129,7 @@ fn_check_steamcmd_clear() { if [ "$(command -v steamcmd 2> /dev/null)" ] && [ -d "${rootdir}/steamcmd" ]; then rm -rf "${steamcmddir:?}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "Removing ${rootdir}/steamcmd" else fn_script_log_pass "Removing ${rootdir}/steamcmd" @@ -163,7 +164,7 @@ fn_update_steamcmd_localbuild() { } fn_update_steamcmd_remotebuild() { - # Get remote build info. + # Gets remote build info. if [ -d "${steamcmddir}" ]; then cd "${steamcmddir}" || exit fi @@ -182,13 +183,14 @@ fn_update_steamcmd_remotebuild() { if [ "${CI}" ]; then ${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +quit > /dev/null 2>&1 fi + # password for branch not needed to check the buildid - remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') + remotebuild=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_request "${appid}" +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -198,7 +200,7 @@ fn_update_steamcmd_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -209,34 +211,35 @@ fn_update_steamcmd_remotebuild() { fn_update_steamcmd_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -n "${betapassword}" ]; then - echo -e "* Branch password: ${betapassword}" + fn_print_nl "* Branch password: ${betapassword}" fi - echo -e "https://steamdb.info/app/${appid}/" - echo -en "\n" + fn_print_nl "${italic}https://steamdb.info/app/${appid}/history" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -n "${betapassword}" ]; then fn_script_log_info "Branch password: ${betapassword}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -255,7 +258,6 @@ fn_update_steamcmd_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir:?}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" @@ -263,21 +265,21 @@ fn_update_steamcmd_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -n "${betapassword}" ]; then - echo -e "* Branch password: ${betapassword}" + fn_print_nl "* Branch password: ${betapassword}" fi - echo -e "https://steamdb.info/app/${appid}/" - echo -en "\n" + fn_print_nl "https://steamdb.info/app/${appid}/history" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi @@ -308,9 +310,9 @@ fn_check_steamcmd_appmanifest() { if [ "${appmanifestfilewc}" -ge "2" ]; then fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" fn_script_log_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" - echo -e "* Check user permissions" + fn_print_nl "* Check user permissions" for appfile in ${appmanifestfile}; do - echo -e " ${appfile}" + fn_print_nl " ${appfile}" done core_exit.sh else @@ -425,4 +427,21 @@ fn_check_steamcmd_appmanifest() { fn_dl_steamcmd fi fi + + # GoldSrc can occasionally report success while core HL1 files are incomplete. + if [ "${engine}" == "goldsrc" ]; then + if [ ! -f "${serverfiles}/hlds_run" ] || [ ! -f "${serverfiles}/engine_i486.so" ] || [ ! -d "${serverfiles}/valve" ]; then + fn_print_error_nl "Core HL1 files missing after GoldSrc update" + fn_script_log_error "Core HL1 files missing after GoldSrc update" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + fn_dl_steamcmd + + if [ ! -f "${serverfiles}/hlds_run" ] || [ ! -f "${serverfiles}/engine_i486.so" ] || [ ! -d "${serverfiles}/valve" ]; then + fn_print_fail_nl "Core HL1 files are still missing after retry" + fn_script_log_fail "Core HL1 files are still missing after retry" + core_exit.sh + fi + fi + fi } diff --git a/lgsm/modules/core_trap.sh b/lgsm/modules/core_trap.sh old mode 100644 new mode 100755 index 4b66b3937..f9ff17ff1 --- a/lgsm/modules/core_trap.sh +++ b/lgsm/modules/core_trap.sh @@ -8,10 +8,12 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_exit_trap() { + local saved_exit_status=$? + echo -e "" if [ -z "${exitcode}" ]; then - exitcode=$? + exitcode=${saved_exit_status} fi - echo -e "" + if [ -z "${exitcode}" ]; then exitcode=0 fi diff --git a/lgsm/modules/fix.sh b/lgsm/modules/fix.sh old mode 100644 new mode 100755 index f9628a335..f31030779 --- a/lgsm/modules/fix.sh +++ b/lgsm/modules/fix.sh @@ -22,7 +22,8 @@ fn_fix_msg_start_nl() { } fn_fix_msg_end() { - if [ $? != 0 ]; then + exirtcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_error_nl "Applying ${fixname} fix: ${gamename}" fn_script_log_error "Applying ${fixname} fix: ${gamename}" else @@ -79,7 +80,7 @@ fi if [ "${commandname}" == "INSTALL" ]; then if grep -qEe "(^|\s)${shortname}(\s|$)" <<< "${apply_post_install_fix[@]}"; then echo -e "" - echo -e "${lightyellow}Applying Post-Install Fixes${default}" + echo -e "${bold}${lightyellow}Applying Post-Install Fixes${default}" fn_messages_separator postinstall=1 fn_apply_fix "post install" "${shortname}" diff --git a/lgsm/modules/fix_ark.sh b/lgsm/modules/fix_ark.sh old mode 100644 new mode 100755 index 366d137dd..3d6913d00 --- a/lgsm/modules/fix_ark.sh +++ b/lgsm/modules/fix_ark.sh @@ -7,7 +7,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# removes mulitple appworkshop_346110.acf if found. +# removes multiple appworkshop_346110.acf if found. steamappsfilewc="$(find "${HOME}" -name appworkshop_346110.acf | wc -l)" if [ "${steamappsfilewc}" -gt "1" ]; then fixname="multiple appworkshop acf files" @@ -15,7 +15,7 @@ if [ "${steamappsfilewc}" -gt "1" ]; then find "${HOME}" -name appworkshop_346110.acf -exec rm -f {} \; fn_fix_msg_end elif [ "${steamappsfilewc}" -eq "1" ]; then - # Steam mods directory selecter + # Steam mods directory selector # This allows LinxuGSM to select either ~/.steam or ~/Steam. depending on what is being used steamappsfile=$(find "${HOME}" -name appworkshop_346110.acf) steamappsdir=$(dirname "${steamappsfile}") diff --git a/lgsm/modules/fix_arma3.sh b/lgsm/modules/fix_arma3.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_av.sh b/lgsm/modules/fix_av.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_bo.sh b/lgsm/modules/fix_bo.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_bt.sh b/lgsm/modules/fix_bt.sh index 51fc3d505..107c84458 100755 --- a/lgsm/modules/fix_bt.sh +++ b/lgsm/modules/fix_bt.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves issues with Barotrauma. -module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: Missing user data directory error. if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Daedalic Entertainment GmbH/Barotrauma" ]; then diff --git a/lgsm/modules/fix_cmw.sh b/lgsm/modules/fix_cmw.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_csgo.sh b/lgsm/modules/fix_csgo.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_dst.sh b/lgsm/modules/fix_dst.sh old mode 100644 new mode 100755 index 2848fa5bb..e4fcc5a1c --- a/lgsm/modules/fix_dst.sh +++ b/lgsm/modules/fix_dst.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer). -# Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS. +# Issue only occurs on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS. if [ -f "/etc/redhat-release" ] && [ ! -f "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" ]; then fixname="libcurl-gnutls.so.4" fn_fix_msg_start diff --git a/lgsm/modules/fix_hw.sh b/lgsm/modules/fix_hw.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_ins.sh b/lgsm/modules/fix_ins.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_kf.sh b/lgsm/modules/fix_kf.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_kf2.sh b/lgsm/modules/fix_kf2.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_mcb.sh b/lgsm/modules/fix_mcb.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_mta.sh b/lgsm/modules/fix_mta.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_nmrih.sh b/lgsm/modules/fix_nmrih.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_onset.sh b/lgsm/modules/fix_onset.sh old mode 100644 new mode 100755 index 6430e5d6b..eeb18f0e2 --- a/lgsm/modules/fix_onset.sh +++ b/lgsm/modules/fix_onset.sh @@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" # Fixes: Failed loading "mariadb": libmariadbclient.so.18: cannot open shared object file: No such file or directory -# Issue only occures on CentOS as libmariadbclient.so.18 is called libmariadb.so.3 on CentOS. +# Issue only occurs on CentOS as libmariadbclient.so.18 is called libmariadb.so.3 on CentOS. if [ -f "/etc/redhat-release" ] && [ ! -f "${serverfiles}/libmariadbclient.so.18" ] && [ -f "/usr/lib64/libmariadb.so.3" ]; then fixname="libmariadbclient.so.18" fn_fix_msg_start diff --git a/lgsm/modules/fix_pvr.sh b/lgsm/modules/fix_pvr.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_ro.sh b/lgsm/modules/fix_ro.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_rust.sh b/lgsm/modules/fix_rust.sh old mode 100644 new mode 100755 index af995a2fa..167a5183d --- a/lgsm/modules/fix_rust.sh +++ b/lgsm/modules/fix_rust.sh @@ -11,7 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedicated_Data/Plugins/x86_64" # Part of random seed feature. -# If seed is not defined by user generate a seed file. +# If the seed is not defined by the user, generate a seed file. if [ -z "${seed}" ] || [ "${seed}" == "0" ]; then if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" @@ -23,7 +23,7 @@ if [ -z "${seed}" ] || [ "${seed}" == "0" ]; then randomseed=1 fi -# If Carbon mod is installed, run enviroment.sh +# If Carbon mod is installed, run environment.sh if [ -f "${serverfiles}/carbon/tools/environment.sh" ]; then fn_print_info_nl "Running Carbon environment.sh" fn_script_log_info "Running Carbon environment.sh" diff --git a/lgsm/modules/fix_rw.sh b/lgsm/modules/fix_rw.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_samp.sh b/lgsm/modules/fix_samp.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_sdtd.sh b/lgsm/modules/fix_sdtd.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_sfc.sh b/lgsm/modules/fix_sfc.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_sm.sh b/lgsm/modules/fix_sm.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_sof2.sh b/lgsm/modules/fix_sof2.sh old mode 100644 new mode 100755 index 45e3b299c..3eb95bc9f --- a/lgsm/modules/fix_sof2.sh +++ b/lgsm/modules/fix_sof2.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM fix_rust.sh module +# LinuxGSM fix_sof2.sh module # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/fix_squad.sh b/lgsm/modules/fix_squad.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_st.sh b/lgsm/modules/fix_st.sh old mode 100644 new mode 100755 index bbd9890bd..887ea987f --- a/lgsm/modules/fix_st.sh +++ b/lgsm/modules/fix_st.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM fix_rust.sh module +# LinuxGSM fix_st.sh module # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/fix_steamcmd.sh b/lgsm/modules/fix_steamcmd.sh old mode 100644 new mode 100755 index 0ba5c85b2..36bc378ac --- a/lgsm/modules/fix_steamcmd.sh +++ b/lgsm/modules/fix_steamcmd.sh @@ -113,6 +113,31 @@ if [ ! -f "${steamclientsdk32}" ]; then fn_fix_msg_end fi +# Helps fix: WARNING: Failed to load 32-bit libtinfo.so.5 or libncurses.so.5. +# On distros that ship libtinfo.so.6 (e.g. Ubuntu 22.04+, Debian 12+) but not +# libtinfo.so.5, SteamCMD prints this warning and loses readline support. +# Creating a symlink from .so.5 -> .so.6 resolves the warning without root. +for libtinfo32dir in "${HOME}/.steam/steamcmd" "${steamcmddir}" "${HOME}/.local/share/Steam/steamcmd"; do + if [ -d "${libtinfo32dir}" ]; then + libtinfo32so="${libtinfo32dir}/libtinfo.so.5" + # Also repair broken symlinks (! -e catches missing target, -L catches dangling link) + if [ ! -e "${libtinfo32so}" ]; then + # Find the .so.6 in the system 32-bit lib paths + for libtinfo32so6 in /lib/i386-linux-gnu/libtinfo.so.6 /usr/lib/i386-linux-gnu/libtinfo.so.6 /lib32/libtinfo.so.6; do + if [ -f "${libtinfo32so6}" ]; then + fixname="libtinfo.so.5 32-bit symlink" + fn_fix_msg_start + mkdir -p "${libtinfo32dir}" + ln -sf "${libtinfo32so6}" "${libtinfo32so}" + exitcode=$? + fn_fix_msg_end + break + fi + done + fi + fi +done + # steamclient.so fixes if [ "${shortname}" == "bo" ]; then fn_fix_steamclient_so "32" "${serverfiles}/BODS_Data/Plugins/x86" diff --git a/lgsm/modules/fix_terraria.sh b/lgsm/modules/fix_terraria.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_tf2.sh b/lgsm/modules/fix_tf2.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_ts3.sh b/lgsm/modules/fix_ts3.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_unt.sh b/lgsm/modules/fix_unt.sh old mode 100644 new mode 100755 index dbe64ffd6..f32737285 --- a/lgsm/modules/fix_unt.sh +++ b/lgsm/modules/fix_unt.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM fix_rust.sh module +# LinuxGSM fix_unt.sh module # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/fix_ut.sh b/lgsm/modules/fix_ut.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_ut2k4.sh b/lgsm/modules/fix_ut2k4.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_ut3.sh b/lgsm/modules/fix_ut3.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_vh.sh b/lgsm/modules/fix_vh.sh old mode 100644 new mode 100755 index 7c1455443..c6564eb19 --- a/lgsm/modules/fix_vh.sh +++ b/lgsm/modules/fix_vh.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM fix_rust.sh module +# LinuxGSM fix_vh.sh module # Author: Alasdair Haig # Website: https://linuxgsm.com # Description: Resolves issues with Valheim. @@ -21,8 +21,8 @@ if [ -f "${modsinstalledlistfullpath}" ]; then rm -rf "${serverfiles}/unstripped_corlib" fi sed -i "s/^dllSearchPathOverride=unstripped_corlib/# &/" "${serverfiles}/doorstop_config.ini" - sed -i "s/^export DOORSTOP_CORLIB_OVERRIDE_PATH="$BASEDIR\/unstripped_corlib"/# &/" "${serverfiles}/start_game_bepinex.sh" - sed -i "s/^export DOORSTOP_CORLIB_OVERRIDE_PATH="${VALHEIM_PLUS_PATH}\/unstripped_corlib"/# &/" "${serverfiles}/start_server_bepinex.sh" + sed -i "s|^export DOORSTOP_CORLIB_OVERRIDE_PATH=\"\\\$BASEDIR/unstripped_corlib\"|# &|" "${serverfiles}/start_game_bepinex.sh" + sed -i "s|^export DOORSTOP_CORLIB_OVERRIDE_PATH=\"\\\${VALHEIM_PLUS_PATH}/unstripped_corlib\"|# &|" "${serverfiles}/start_server_bepinex.sh" fi # special exports for BepInEx if installed if grep -qE "^bepinexvh" "${modsinstalledlistfullpath}"; then diff --git a/lgsm/modules/fix_wurm.sh b/lgsm/modules/fix_wurm.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_xnt.sh b/lgsm/modules/fix_xnt.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_zmr.sh b/lgsm/modules/fix_zmr.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/info_distro.sh b/lgsm/modules/info_distro.sh old mode 100644 new mode 100755 index 0813554dc..1d74ac635 --- a/lgsm/modules/info_distro.sh +++ b/lgsm/modules/info_distro.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Variables providing useful info on the Operating System such as disk and performace info. +# Description: Variables providing useful info on the Operating System such as disk and performance info. # Used for command_details.sh, command_debug.sh and alert.sh. # !Note: When adding variables to this script, ensure that they are also added to the command_dev_parse_distro_details.sh script. @@ -13,9 +13,9 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${status}" == "1" ]; then gameserverpid="$(tmux -L "${socketname}" list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')" if [ "${engine}" == "source" ]; then - srcdslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep srcds_linux | awk '{print $2}')" + srcdslinuxpid="$(pgrep -P "${gameserverpid}" -x srcds_linux 2> /dev/null | head -n 1)" elif [ "${engine}" == "goldsrc" ]; then - hldslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep hlds_linux | awk '{print $2}')" + hldslinuxpid="$(pgrep -P "${gameserverpid}" -x hlds_linux 2> /dev/null | head -n 1)" fi fi ### Distro information @@ -188,13 +188,10 @@ if [ "$(command -v numfmt 2> /dev/null)" ]; then else # Older distros will need to use free. # Older versions of free do not support -h option. - if [ "$( - free -h > /dev/null 2>&1 - echo $? - )" -ne "0" ]; then - humanreadable="-m" - else + if free -h > /dev/null 2>&1; then humanreadable="-h" + else + humanreadable="-m" fi physmemtotalmb="$(free -m | awk '/Mem:/ {print $2}')" # integer physmemtotalgb="$(free -m | awk '/Mem:/ {print $2}')" # integer @@ -255,11 +252,11 @@ if [ -d "${backupdir}" ]; then backupcount=0 # If there are backups in backup dir. - if [ "$(find "${backupdir}" -name "*.tar.gz" | wc -l)" -ne "0" ]; then + if [ "$(find "${backupdir}" -maxdepth 1 -type f -name "*.tar.*" | wc -l)" -ne "0" ]; then # number of backups. - backupcount="$(find "${backupdir}"/*.tar.gz | wc -l)" # integer + backupcount="$(find "${backupdir}" -maxdepth 1 -type f -name "*.tar.*" | wc -l)" # integer # most recent backup. - lastbackup="$(ls -1t "${backupdir}"/*.tar.gz | head -1)" # string + lastbackup="$(find "${backupdir}" -maxdepth 1 -type f -name "*.tar.*" -printf '%T@ %p\n' 2> /dev/null | sort -nr | head -n 1 | cut -d' ' -f2-)" # string # date of most recent backup. lastbackupdate="$(date -r "${lastbackup}")" # string # no of days since last backup. @@ -275,7 +272,7 @@ netlink=$(${ethtoolcommand} "${netint}" 2> /dev/null | grep Speed | awk '{print # Sets the SteamCMD glibc requirement if the game server requirement is less or not required. if [ "${appid}" ]; then - if [ "${glibc}" = "null" ] || [ -z "${glibc}" ] || [ "$(printf '%s\n'${glibc}'\n' "2.14" | sort -V | head -n 1)" != "2.14" ]; then + if [ "${glibc}" = "null" ] || [ -z "${glibc}" ] || [ "$(printf '%s\n' "${glibc}" "2.14" | sort -V | head -n 1)" != "2.14" ]; then glibc="2.14" fi fi diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh old mode 100644 new mode 100755 index 62292ffa0..d39e2d143 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -350,7 +350,7 @@ fn_info_game_av() { rconenabled="${rconenabled:-"false"}" rconpassword="${rconpassword:-"NOT SET"}" rconport="${rconport:-"0"}" - # queryport doesnt respond to any queries, using session only. + # queryport doesn't respond to any queries, using session only. queryport=""$((port + 3))"" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" @@ -673,7 +673,7 @@ fn_info_game_st() { saveinterval="${saveinterval:-"0"}" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" - worldname="${worldname:-"NOT SET"}" + worldsave="${worldsave:-"NOT SET"}" worldtype="${worldtype:-"NOT SET"}" } @@ -936,6 +936,8 @@ fn_info_game_armar() { fn_info_game_json "queryport" ".a2s.port" fn_info_game_json "servername" ".game.name" fn_info_game_json "serverpassword" ".game.password" + fn_info_game_json "rconpassword" ".rcon.password" + fn_info_game_json "rconport" ".rcon.port" fi adminpassword="${adminpassword:-"NOT SET"}" battleeyeport="$((port + 4))" @@ -957,13 +959,14 @@ fn_info_game_bf1942() { fn_info_game_keyvalue_pairs_space "configip" "game.serverIP" fn_info_game_keyvalue_pairs_space "maxplayers" "game.serverMaxPlayers" fn_info_game_keyvalue_pairs_space "port" "game.serverPort" + fn_info_game_keyvalue_pairs_space "queryport" "game.gameSpyPort" fn_info_game_keyvalue_pairs_space "servername" "game.serverName" fn_info_game_keyvalue_pairs_space "serverpassword" "game.serverPassword" fi configip="${configip:-"0.0.0.0"}" maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" - queryport="22000" + queryport="${queryport:-"0"}" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" } @@ -980,11 +983,12 @@ fn_info_game_bfv() { fn_info_game_keyvalue_pairs_space "port" "game.serverPort" fn_info_game_keyvalue_pairs_space "servername" "game.serverName" fn_info_game_keyvalue_pairs_space "serverpassword" "game.serverPassword" + fn_info_game_keyvalue_pairs_space "queryport" "game.gameSpyPort" fi configip="${configip:-"0.0.0.0"}" maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" - queryport="22000" + queryport="${queryport:-"0"}" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" } @@ -1989,6 +1993,7 @@ fn_info_game_sf() { port="${port:-"0"}" queryport="${queryport:-"0"}" beaconport="${beaconport:-"0"}" + reliableport="${reliableport:-"0"}" } # Config Type: Parameters (with an ini) @@ -2402,7 +2407,7 @@ elif [ "${shortname}" == "pc" ]; then fn_info_game_pc elif [ "${shortname}" == "pc2" ]; then fn_info_game_pc2 -elif [ "${shortname}" == "ps" ]; then +elif [ "${shortname}" == "squad44" ]; then fn_info_game_ps elif [ "${shortname}" == "pvr" ]; then fn_info_game_pvr @@ -2509,7 +2514,7 @@ if [ ! -f "${tmpdir}/publicip.json" ] || [ "$(find "${tmpdir}/publicip.json" -mm ipresponse=$(curl -s --max-time 3 "${apiurl}") # Attempt to query ip-api.com with a 3 second timeout exitcode=$? - # Check if the first request was successfull + # Check if the first request was successful if [ "${exitcode}" -eq 0 ]; then fn_script_log_pass "Queried ${apiurl} for public IP address" @@ -2527,7 +2532,7 @@ if [ ! -f "${tmpdir}/publicip.json" ] || [ "$(find "${tmpdir}/publicip.json" -mm ipresponse=$(curl -s --max-time 3 "${apiurl}") # Attempt to query myip.wtf with a 3 second timeout as a backup exitcode=$? - # Check if the backup request was successfull + # Check if the backup request was successful if [ "${exitcode}" -eq 0 ]; then fn_script_log_pass "Queried ${apiurl} for public IP address" diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh old mode 100644 new mode 100755 index ff4b5d870..1ef950830 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -7,6 +7,29 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +# Converts querytype to imgsoquerytype for use with ismygameserver.online urls +if [ -n "${querytype}" ]; then + if [ "${querytype}" == "protocol-valve" ]; then + imgsoquerytype="valve" + elif [ "${querytype}" == "protocol-gamespy1" ]; then + imgsoquerytype="gamespy" + elif [ "${querytype}" == "protocol-gamespy2" ]; then + imgsoquerytype="gamespy" + elif [ "${querytype}" == "protocol-gamespy3" ]; then + imgsoquerytype="gamespy" + elif [ "${querytype}" == "protocol-quake1" ]; then + imgsoquerytype="quake" + elif [ "${querytype}" == "protocol-quake2" ]; then + imgsoquerytype="quake" + elif [ "${querytype}" == "protocol-quake3" ]; then + imgsoquerytype="quake" + elif [ "${querytype}" == "protocol-unreal2" ]; then + imgsoquerytype="unrealtournament2004" + else + imgsoquerytype="${querytype}" + fi +fi + # Removes the passwords form all but details. fn_info_messages_password_strip() { if [ "${commandname}" != "DETAILS" ]; then @@ -66,6 +89,11 @@ fn_info_messages_head() { echo -e "Hostname" echo -e "${HOSTNAME}" echo -e "" + if [ -n "${querytype}" ]; then + echo -e "Is my Game Server Online?" + echo -e "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}" + echo -e "" + fi echo -e "Server Time" echo -e "$(date)" } @@ -132,7 +160,7 @@ fn_info_messages_server_resource() { echo -e "${bold}${lightyellow}Server Resource${default}" fn_messages_separator { - echo -e "${lightyellow}CPU\t${default}" + echo -e "${bold}${lightyellow}CPU\t${default}" echo -e "${lightblue}Model:\t${default}${cpumodel}" echo -e "${lightblue}Cores:\t${default}${cpucores}" echo -e "${lightblue}Frequency:\t${default}${cpufreqency}MHz" @@ -140,14 +168,14 @@ fn_info_messages_server_resource() { } | column -s $'\t' -t echo -e "" { - echo -e "${lightyellow}Memory\t${default}" + echo -e "${bold}${lightyellow}Memory\t${default}" echo -e "${lightblue}Mem:\t${lightblue}total\tused\tfree\tcached\tavailable${default}" echo -e "${lightblue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}" echo -e "${lightblue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}" } | column -s $'\t' -t echo -e "" { - echo -e "${lightyellow}Storage${default}" + echo -e "${bold}${lightyellow}Storage${default}" echo -e "${lightblue}Filesystem:\t${default}${filesystem}" echo -e "${lightblue}Total:\t${default}${totalspace}" echo -e "${lightblue}Used:\t${default}${usedspace}" @@ -155,7 +183,7 @@ fn_info_messages_server_resource() { } | column -s $'\t' -t echo -e "" { - echo -e "${lightyellow}Network${default}" + echo -e "${bold}${lightyellow}Network${default}" if [ -n "${netint}" ]; then echo -e "${lightblue}Interface:\t${default}${netint}" fi @@ -203,7 +231,7 @@ fn_info_messages_gameserver_resource() { } | column -s $'\t' -t echo -e "" { - echo -e "${lightyellow}Storage${default}" + echo -e "${bold}${lightyellow}Storage${default}" echo -e "${lightblue}Total:\t${default}${rootdirdu}" echo -e "${lightblue}Serverfiles:\t${default}${serverfilesdu}" if [ -d "${backupdir}" ]; then @@ -292,7 +320,7 @@ fn_info_messages_gameserver() { echo -e "${lightblue}Server password:\t${default}${serverpassword}" fi - # Query enabled (Starbound) + # Query enabled (Starbound, Minecraft) if [ -n "${queryenabled}" ]; then echo -e "${lightblue}Query enabled:\t${default}${queryenabled}" fi @@ -341,7 +369,7 @@ fn_info_messages_gameserver() { fi fi - # Reverved Slots + # Reserved Slots if [ -n "${statspassword}" ]; then echo -e "${lightblue}Reserved Slots:\t${default}${reservedslots}" fi @@ -503,6 +531,11 @@ fn_info_messages_gameserver() { else echo -e "${lightblue}Status:\t${green}STARTED${default}" fi + + # ismygameserver.online + if [ -n "${querytype}" ]; then + echo -e "${lightblue}Query Check:\t${default}https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}" + fi } | column -s $'\t' -t echo -e "" } @@ -545,7 +578,7 @@ fn_info_messages_script() { : elif [ -z "${glibc}" ]; then echo -e "${lightblue}glibc required:\t${red}UNKNOWN${default}" - elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then + elif [ "$(printf '%s\n' "${glibc}" "${glibcversion}" | sort -V | head -n 1)" != "${glibc}" ]; then echo -e "${lightblue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})" else echo -e "${lightblue}glibc required:\t${green}${glibc}${default}" @@ -553,23 +586,41 @@ fn_info_messages_script() { fi # Discord alert - echo -e "${lightblue}Discord alert:\t${default}${discordalert}" + if [ "${discordalert}" == "on" ]; then + echo -e "${lightblue}Discord alert:\t${default}${discordalert}" + fi # Email alert - echo -e "${lightblue}Email alert:\t${default}${emailalert}" + if [ "${emailalert}" == "on" ]; then + echo -e "${lightblue}Email alert:\t${default}${emailalert}" + fi # Gotify alert - echo -e "${lightblue}Gotify alert:\t${default}${gotifyalert}" + if [ "${gotifyalert}" == "on" ]; then + echo -e "${lightblue}Gotify alert:\t${default}${gotifyalert}" + fi # IFTTT alert - echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}" + if [ "${iftttalert}" == "on" ]; then + echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}" + fi # Pushbullet alert - echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}" + if [ "${pushbulletalert}" == "on" ]; then + echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}" + fi # Pushover alert - echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}" + if [ "${pushoveralert}" == "on" ]; then + echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}" + fi # Rocketchat alert - echo -e "${lightblue}Rocketchat alert:\t${default}${rocketchatalert}" + if [ "${rocketchatalert}" == "on" ]; then + echo -e "${lightblue}Rocketchat alert:\t${default}${rocketchatalert}" + fi # Slack alert - echo -e "${lightblue}Slack alert:\t${default}${slackalert}" + if [ "${slackalert}" == "on" ]; then + echo -e "${lightblue}Slack alert:\t${default}${slackalert}" + fi # Telegram alert - echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}" + if [ "${telegramalert}" == "on" ]; then + echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}" + fi # Update on start if [ -n "${updateonstart}" ]; then @@ -1453,6 +1504,7 @@ fn_info_messages_sf() { fn_port "Game" port udp fn_port "Query" queryport udp fn_port "Beacon" beaconport udp + fn_port "ReliableMessaging" reliableport tcp } | column -s $'\t' -t } @@ -1461,6 +1513,7 @@ fn_info_messages_sm() { { fn_port "header" fn_port "Game" port udp + fn_port "Game" port tcp fn_port "Query" queryport udp fn_port "Telnet" telnetport tcp } | column -s $'\t' -t @@ -1608,7 +1661,7 @@ fn_info_messages_tf() { { fn_port "header" fn_port "Game" port udp - fn_port "Query" queryport tcp + fn_port "Query" queryport udp fn_port "Beacon" beaconport udp fn_port "Shutdown" shutdownport tcp } | column -s $'\t' -t @@ -1841,7 +1894,7 @@ fn_info_messages_select_engine() { fn_info_messages_pc elif [ "${shortname}" == "pc2" ]; then fn_info_messages_pc2 - elif [ "${shortname}" == "ps" ]; then + elif [ "${shortname}" == "squad44" ]; then fn_info_messages_ps elif [ "${shortname}" == "pvr" ]; then fn_info_messages_pvr diff --git a/lgsm/modules/info_stats.sh b/lgsm/modules/info_stats.sh old mode 100644 new mode 100755 index b995d0e3b..c8a96552a --- a/lgsm/modules/info_stats.sh +++ b/lgsm/modules/info_stats.sh @@ -23,10 +23,10 @@ fi if [ ! -f "${datadir}/uuid-${selfname}.txt" ] || [ ! -f "${datadir}/uuid-install.txt" ]; then # download dictionary words if [ ! -f "${datadir}/name-left.csv" ]; then - fn_fetch_file_github "${datadir}" "name-left.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash" + fn_fetch_file_github "lgsm/data" "name-left.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash" fi if [ ! -f "${datadir}/name-right.csv" ]; then - fn_fetch_file_github "${datadir}" "name-right.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash" + fn_fetch_file_github "lgsm/data" "name-right.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash" fi # generate instance uuid diff --git a/lgsm/modules/install_complete.sh b/lgsm/modules/install_complete.sh old mode 100644 new mode 100755 index 0ee01954a..c84e35fe0 --- a/lgsm/modules/install_complete.sh +++ b/lgsm/modules/install_complete.sh @@ -8,25 +8,24 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -fn_messages_separator -if [ "${exitcode}" == "1" ]; then +if [ "${exitcode}" -eq 1 ]; then echo -e "${bold}${red}Install Failed!${default}" fn_script_log_fail "Install Failed!" -elif [ "${exitcode}" == "2" ]; then +elif [ "${exitcode}" -eq 2 ]; then echo -e "${bold}${red}Install Completed with Errors!${default}}" fn_script_log_error "Install Completed with Errors!" -elif [ "${exitcode}" == "3" ]; then +elif [ "${exitcode}" -eq 3 ]; then echo -e "${bold}${lightyellow}Install Completed with Warnings!${default}}" fn_script_log_warn "Install Completed with Warnings!" -elif [ -z "${exitcode}" ] || [ "${exitcode}" == "0" ]; then +elif [ -z "${exitcode}" ] || [ "${exitcode}" -eq 0 ]; then echo -e "${bold}${green}Install Complete!${default}" fn_script_log_pass "Install Complete!" fi +fn_messages_separator -fn_script_log_info "Install Complete!" echo -e "" -echo -e "To start server type:" -echo -e "./${selfname} start" +echo -e "To start the ${gamename} server type:" +echo -e "${italic}./${selfname} start${default}" echo -e "" core_exit.sh diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh old mode 100644 new mode 100755 index fcc36e63d..e25b8de5c --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -16,46 +16,102 @@ fn_check_cfgdir() { fi } -# Downloads default configs from Game-Server-Configs repo to lgsm/config-default. -fn_fetch_default_config() { +# Copies default configs from Game-Server-Configs repo to server config location. +fn_default_config_remote() { echo -e "" echo -e "${bold}${lightyellow}Downloading ${gamename} Configs${default}" fn_messages_separator - echo -e "Downloading default configs from:" - echo -e "" - echo -e "${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}" + echo -e "Downloading default configs from: ${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}" echo -e "" fn_sleep_time_1 mkdir -p "${lgsmdir}/config-default/config-game" githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main" for config in "${array_configs[@]}"; do + # Downloads default configs from Game-Server-Configs repo to lgsm/config-default. fn_fetch_file "${githuburl}/${shortname}/${config}" "${remote_fileurl_backup}" "GitHub" "Bitbucket" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nohash" - done -} -# Copys default configs from Game-Server-Configs repo to server config location. -fn_default_config_remote() { - for config in "${array_configs[@]}"; do - # every config is copied - echo -e "copying ${config} config file." - fn_script_log_info "Copying ${servercfg} config file." + # Every config is copied. if [ "${config}" == "${servercfgdefault}" ]; then mkdir -p "${servercfgdir}" - cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" + echo -en "copying config file [ ${italic}${servercfgfullpath}${default} ]" + if [ ! -e "${servercfgfullpath}" ] && [ ! -L "${servercfgfullpath}" ]; then + cp "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" + exitcode=$? + [ "${exitcode}" -eq 0 ] && changes="copied" + else + exitcode=0 + fi + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "copying config file ${servercfgfullpath}" + elif [ "${changes}" != "" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "copying config file ${servercfgfullpath}" + else + fn_print_skip_eol_nl + fi elif [ "${shortname}" == "arma3" ] && [ "${config}" == "${networkcfgdefault}" ]; then mkdir -p "${servercfgdir}" - cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}" + echo -en "copying config file [ ${italic}${networkcfgfullpath}${default} ]" + if [ ! -e "${networkcfgfullpath}" ] && [ ! -L "${networkcfgfullpath}" ]; then + cp "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}" + exitcode=$? + [ "${exitcode}" -eq 0 ] && changes="copied" + else + exitcode=0 + fi + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "copying config file ${networkcfgdefault}" + elif [ "${changes}" != "" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "copying config file ${networkcfgdefault}" + else + fn_print_skip_eol_nl + fi elif [ "${shortname}" == "dst" ] && [ "${config}" == "${clustercfgdefault}" ]; then - cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" + echo -en "copying config file [ ${italic}${clustercfgfullpath}${default} ]" + if [ ! -e "${clustercfgfullpath}" ] && [ ! -L "${clustercfgfullpath}" ]; then + cp "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" + exitcode=$? + [ "${exitcode}" -eq 0 ] && changes="copied" + else + exitcode=0 + fi + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "copying config file ${clustercfgfullpath}" + elif [ "${changes}" != "" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "copying config file ${clustercfgfullpath}" + else + fn_print_skip_eol_nl + fi else - mkdir -p "${servercfgdir}" - cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}" + echo -en "copying config file [ ${italic}${servercfgdir}/${config}${default} ]" + if [ ! -e "${servercfgdir}/${config}" ] && [ ! -L "${servercfgdir}/${config}" ]; then + cp "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}" + exitcode=$? + [ "${exitcode}" -eq 0 ] && changes="copied" + else + exitcode=0 + fi + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "copying config file ${servercfgdir}/${config}" + elif [ "${changes}" != "" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "copying config file ${servercfgdir}/${config}" + else + fn_print_skip_eol_nl + fi fi + + unset changes done - fn_sleep_time } -# Copys local default config to server config location. +# Copies local default config to server config location. fn_default_config_local() { echo -e "" echo -e "${bold}${lightyellow}Copying ${gamename} Configs${default}" @@ -71,7 +127,7 @@ fn_default_config_local() { echo -en "copying config file [ ${italic}${servercfgdefault}${default} ]: " cp --update=none "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol fn_script_log_fail "copying config file [ ${servercfgdefault} ]: " else @@ -87,30 +143,48 @@ fn_set_config_vars() { if [ -f "${servercfgfullpath}" ]; then randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs) servername="LinuxGSM" - rconpass="admin${randomstring}" - echo -e "changing hostname." - fn_script_log_info "Changing hostname." + adminpass="admin${randomstring}" + echo -en "setting hostname\c" + fn_script_log_info "setting hostname" fn_sleep_time # prevents var from being overwritten with the servername. if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2> /dev/null; then - sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g" "${servercfgfullpath}" + changes+=$(sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g w /dev/stdout" "${servercfgfullpath}") elif grep -q "SERVERNAME=\"SERVERNAME\"" "${lgsmdir}/config-default/config-game/${config}" 2> /dev/null; then - sed -i "s/SERVERNAME=\"SERVERNAME\"/SERVERNAME=\"${servername}\"/g" "${servercfgfullpath}" + changes+=$(sed -i "s/SERVERNAME=\"SERVERNAME\"/SERVERNAME=\"${servername}\"/g w /dev/stdout" "${servercfgfullpath}") else - sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}" + changes+=$(sed -i "s/SERVERNAME/${servername}/g w /dev/stdout" "${servercfgfullpath}") fi - echo -e "changing rcon/admin password." - fn_script_log_info "Changing rcon/admin password." - if [ "${shortname}" == "squad" ]; then - sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgdir}/Rcon.cfg" + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol + fn_script_log_fail "setting hostname" + elif [ "${changes}" != "" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "setting hostname" else - sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}" + fn_print_skip_eol_nl fi + + echo -en "generating admin/rcon password\c" + fn_script_log_info "generating admin/rcon password" fn_sleep_time - else - fn_script_log_warn "Config file not found, cannot alter it." - echo -e "Config file not found, cannot alter it." - fn_sleep_time + if [ "${shortname}" == "squad" ]; then + changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgdir}/Rcon.cfg") + else + changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgfullpath}") + fi + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol + fn_script_log_fail "generating admin/rcon password" + elif [ "${changes}" != "" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "generating admin/rcon password" + else + fn_print_skip_eol_nl + fi + unset changes fi } @@ -164,22 +238,22 @@ fn_set_dst_config_vars() { echo -e "" } -# Lists local config file locations +# Lists local config locations fn_list_config_locations() { echo -e "" echo -e "${bold}${lightyellow}Config Locations${default}" fn_messages_separator if [ -n "${servercfgfullpath}" ]; then if [ -f "${servercfgfullpath}" ]; then - echo -e "Game Server Config File: ${servercfgfullpath}" + echo -e "${gamename} config file: ${italic}${servercfgfullpath}${default}" elif [ -d "${servercfgfullpath}" ]; then - echo -e "Game Server Config Dir: ${servercfgfullpath}" + echo -e "${gamename} config directory: ${italic}${servercfgfullpath}" else - echo -e "Config file: ${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})" + echo -e "${gamename} config: ${italic}${red}${servercfgfullpath}${default} (${red}CONFIG IS MISSING${default})" fi fi - echo -e "LinuxGSM Config: ${lgsmdir}/config-lgsm/${gameservername}" - echo -e "Documentation: https://docs.linuxgsm.com/configuration/game-server-config" + echo -e "LinuxGSM config: ${italic}${lgsmdir}/config-lgsm/${gameservername}${default}" + echo -e "Config documentation: ${italic}https://docs.linuxgsm.com/configuration${default}" } if [ "${shortname}" == "sdtd" ]; then @@ -187,254 +261,206 @@ if [ "${shortname}" == "sdtd" ]; then fn_list_config_locations elif [ "${shortname}" == "ac" ]; then array_configs+=(server_cfg.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ahl" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ahl2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ark" ]; then - fn_check_cfgdir array_configs+=(GameUserSettings.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "arma3" ]; then - fn_check_cfgdir array_configs+=(server.cfg network.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "armar" ]; then - fn_check_cfgdir array_configs+=(server.json) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ats" ]; then - fn_check_cfgdir array_configs+=(server_config.sii) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bo" ]; then array_configs+=(config.txt) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bd" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bt" ]; then - fn_check_cfgdir array_configs+=(serversettings.xml) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "btl" ]; then fn_check_cfgdir array_configs+=(Game.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bf1942" ]; then array_configs+=(serversettings.con) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bfv" ]; then array_configs+=(serversettings.con) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bs" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bb" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bb2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bmdm" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ck" ]; then array_configs+=(ServerConfig.json) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cod" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "coduo" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cod2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cod4" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "codwaw" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cc" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "col" ]; then array_configs+=(colserver.json) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cs" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cs2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cscz" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "csgo" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "css" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ct" ]; then array_configs+=(ServerSetting.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dayz" ]; then - fn_check_cfgdir array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dod" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dodr" ]; then array_configs+=(Game.ini) - fn_fetch_default_config fn_default_config_remote fn_list_config_locations elif [ "${shortname}" == "dods" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "doi" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dmc" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dst" ]; then - fn_check_cfgdir array_configs+=(cluster.ini server.ini) - fn_fetch_default_config fn_default_config_remote fn_set_dst_config_vars fn_list_config_locations elif [ "${shortname}" == "dab" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dys" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "eco" ]; then array_configs+=(Network.eco) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -443,62 +469,51 @@ elif [ "${shortname}" == "em" ]; then fn_list_config_locations elif [ "${shortname}" == "etl" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ets2" ]; then - fn_check_cfgdir array_configs+=(server_config.sii) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "fctr" ]; then array_configs+=(server-settings.json) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "fof" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "gmod" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "hldm" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "hldms" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ohd" ]; then array_configs+=(Admins.cfg Engine.ini Game.ini MapCycle.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "opfor" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "hl2dm" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -507,13 +522,11 @@ elif [ "${shortname}" == "hz" ]; then : elif [ "${shortname}" == "ins" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ios" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -522,118 +535,99 @@ elif [ "${shortname}" == "jbep3" ]; then fn_list_config_locations elif [ "${shortname}" == "jc2" ]; then array_configs+=(config.lua) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "jc3" ]; then array_configs+=(config.json) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "kf" ]; then array_configs+=(Default.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "l4d" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "l4d2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then array_configs+=(server.properties) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mcb" ]; then array_configs+=(server.properties) - fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "mcv" ]; then + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mohaa" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mh" ]; then - fn_check_cfgdir array_configs+=(Game.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ns" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "nmrih" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "nd" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mta" ]; then - fn_check_cfgdir array_configs+=(acl.xml mtaserver.conf vehiclecolors.conf) - fn_fetch_default_config fn_default_config_remote fn_list_config_locations elif [ "${shortname}" == "pvr" ]; then - fn_check_cfgdir array_configs+=(Game.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars elif [ "${shortname}" == "pvkii" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "pw" ]; then array_configs+=(PalWorldSettings.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "pz" ]; then - fn_check_cfgdir array_configs+=(server.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "nec" ]; then - fn_check_cfgdir array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "pc" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -642,177 +636,153 @@ elif [ "${shortname}" == "pc2" ]; then fn_list_config_locations elif [ "${shortname}" == "q2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "q3" ]; then array_configs+=(server.cfg) - fn_fetch_default_configs fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "q4" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ql" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "jk2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars elif [ "${shortname}" == "qw" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ricochet" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "rtcw" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "rust" ]; then - fn_check_cfgdir array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_list_config_locations elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then array_configs+=(config_gameplay.txt config_localadmin.txt) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sf" ]; then array_configs+=(GameUserSettings.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "sm" ]; then - fn_default_config_local - fn_list_config_locations elif [ "${shortname}" == "sol" ]; then array_configs+=(soldat.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sof2" ]; then array_configs+=(server.cfg mapcycle.txt) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sfc" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "squad" ]; then array_configs+=(Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sb" ]; then array_configs+=(starbound_server.config) - fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "st" ]; then + array_configs+=(setting.xml) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "stn" ]; then array_configs+=(ServerConfig.txt ServerUsers.txt TpPresets.json UserPermissions.json) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sven" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "tf2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "tf2c" ]; then + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "tfc" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ti" ]; then array_configs+=(Game.ini Engine.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ts" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ts3" ]; then array_configs+=(ts3server.ini) - fn_fetch_default_config fn_default_config_remote fn_list_config_locations elif [ "${shortname}" == "tw" ]; then array_configs+=(server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "terraria" ]; then array_configs+=(serverconfig.txt) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "tu" ]; then - fn_check_cfgdir array_configs+=(TowerServer.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ut" ]; then array_configs+=(Game.ini Engine.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ut2k4" ]; then array_configs+=(UT2004.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ut99" ]; then array_configs+=(Default.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -824,49 +794,42 @@ elif [ "${shortname}" == "vints" ]; then : elif [ "${shortname}" == "vs" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "wet" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "wf" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "wmc" ]; then array_configs+=(config.yml) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "xnt" ]; then + fix_xnt.sh array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "wurm" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "zmr" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "zps" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations diff --git a/lgsm/modules/install_dst_token.sh b/lgsm/modules/install_dst_token.sh old mode 100644 new mode 100755 index fd0b4727b..93ac1b8a4 --- a/lgsm/modules/install_dst_token.sh +++ b/lgsm/modules/install_dst_token.sh @@ -12,7 +12,7 @@ echo -e "${bold}${lightyellow}Enter ${gamename} Cluster Token${default}" fn_messages_separator echo -e "A cluster token is required to run this server!" echo -e "Follow the instructions in this link to obtain this key:" -echo -e "https://linuxgsm.com/dst-auth-token" +echo -e "${italic}https://linuxgsm.com/dst-auth-token" echo -e "" if [ -z "${autoinstall}" ]; then overwritetoken="true" diff --git a/lgsm/modules/install_eula.sh b/lgsm/modules/install_eula.sh old mode 100644 new mode 100755 index 272ff205a..f32a1931e --- a/lgsm/modules/install_eula.sh +++ b/lgsm/modules/install_eula.sh @@ -19,11 +19,11 @@ echo -e "" echo -e "${bold}${lightyellow}Accept ${gamename} EULA${default}" fn_messages_separator echo -e "You are required to accept the EULA:" -echo -e "${eulaurl}" +echo -e "" +echo -e "${italic}${eulaurl}${default}" echo -e "" if [ -z "${autoinstall}" ]; then echo -e "By continuing you are indicating your agreement to the EULA." - echo -e "" if ! fn_prompt_yn "Continue?" Y; then exitcode=0 core_exit.sh diff --git a/lgsm/modules/install_factorio_save.sh b/lgsm/modules/install_factorio_save.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_gslt.sh b/lgsm/modules/install_gslt.sh old mode 100644 new mode 100755 index 960b1e20c..e4e4dbad7 --- a/lgsm/modules/install_gslt.sh +++ b/lgsm/modules/install_gslt.sh @@ -11,17 +11,16 @@ echo -e "" echo -e "${bold}${lightyellow}Game Server Login Token${default}" fn_messages_separator if [ "${shortname}" == "csgo" ] || [ "${shortname}" == "css" ] || [ "${shortname}" == "nmrih" ] || [ "${shortname}" == "bs" ]; then - echo -e "GSLT is required to run a public ${gamename} server" + echo -e "GSLT is required to run a public ${gamename} server." fn_script_log_info "GSLT is required to run a public ${gamename} server" else - echo -e "GSLT is an optional feature for ${gamename} server" + echo -e "GSLT is an optional feature for ${gamename} server." fn_script_log_info "GSLT is an optional feature for ${gamename} server" fi -echo -e "Get more info and a token here:" -echo -e "https://docs.linuxgsm.com/steamcmd/gslt" -fn_script_log_info "Get more info and a token here:" -fn_script_log_info "https://docs.linuxgsm.com/steamcmd/gslt" +echo -e "" +echo -e "More info: ${italic}https://docs.linuxgsm.com/steamcmd/gslt${default}" +fn_script_log_info "More info: https://docs.linuxgsm.com/steamcmd/gslt" echo -e "" if [ -z "${autoinstall}" ]; then if [ "${shortname}" != "tu" ]; then @@ -37,11 +36,10 @@ if [ -z "${autoinstall}" ]; then fi if [ "${shortname}" == "tu" ]; then - echo -e "The GSLT can be changed by editing ${servercfgdir}/${servercfg}." - fn_script_log_info "The GSLT can be changed by editing ${servercfgdir}/${servercfg}." + echo -e "The GSLT can be changed by editing: ${italic}${servercfgdir}/${servercfg}${default}" + fn_script_log_info "The GSLT can be changed by editing: ${servercfgdir}/${servercfg}." else - echo -e "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg." - fn_script_log_info "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg." + echo -e "The GSLT can be changed by editing: ${italic}${configdirserver}/${selfname}.cfg${default}" + fn_script_log_info "The GSLT can be changed by editing: ${configdirserver}/${selfname}.cfg." fi fn_sleep_time_1 -echo -e "" diff --git a/lgsm/modules/install_header.sh b/lgsm/modules/install_header.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_logs.sh b/lgsm/modules/install_logs.sh old mode 100644 new mode 100755 index 3e522a082..9e1b89dbd --- a/lgsm/modules/install_logs.sh +++ b/lgsm/modules/install_logs.sh @@ -7,93 +7,117 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ "${checklogs}" != "1" ]; then +if [ -z "${checklogs}" ]; then echo -e "" echo -e "${bold}${lightyellow}Creating Log Directories${default}" fn_messages_separator fi -# Create LinuxGSM logs. -echo -en "installing log dir: ${logdir}..." -mkdir -p "${logdir}" -if [ $? != 0 ]; then - fn_print_fail_eol_nl - core_exit.sh -else - fn_print_ok_eol_nl -fi -echo -en "installing LinuxGSM log dir: ${lgsmlogdir}..." -mkdir -p "${lgsmlogdir}" -if [ $? != 0 ]; then - fn_print_fail_eol_nl - core_exit.sh +echo -en "creating log directory [ ${italic}${logdir}${default} ]" +if [ ! -d "${logdir}" ]; then + if ! mkdir -p "${logdir}"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi else - fn_print_ok_eol_nl + fn_print_skip_eol_nl fi -echo -en "creating LinuxGSM log: ${lgsmlog}..." -touch "${lgsmlog}" -if [ $? != 0 ]; then - fn_print_fail_eol_nl - core_exit.sh + +echo -en "creating script log directory [ ${italic}${lgsmlogdir}${default} ]" +if [ ! -d "${lgsmlogdir}" ]; then + if ! mkdir -p "${lgsmlogdir}"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi else - fn_print_ok_eol_nl + fn_print_skip_eol_nl fi -# Create Console logs. -if [ "${consolelogdir}" ]; then - echo -en "installing console log dir: ${consolelogdir}..." - mkdir -p "${consolelogdir}" - if [ $? != 0 ]; then + +echo -en "creating script log [ ${italic}${lgsmlog}${default} ]" +if [ ! -f "${lgsmlog}" ]; then + if ! touch "${lgsmlog}"; then fn_print_fail_eol_nl core_exit.sh else fn_print_ok_eol_nl fi - echo -en "creating console log: ${consolelog}..." - if ! touch "${consolelog}"; then +else + fn_print_skip_eol_nl +fi + +echo -en "creating console log directory [ ${italic}${consolelogdir}${default} ]" +if [ ! -d "${consolelogdir}" ]; then + if ! mkdir -p "${consolelogdir}"; then fn_print_fail_eol_nl core_exit.sh else fn_print_ok_eol_nl fi +else + fn_print_skip_eol_nl fi -# Create Game logs. -if [ "${gamelogdir}" ] && [ ! -d "${gamelogdir}" ]; then - echo -en "installing game log dir: ${gamelogdir}..." - if ! mkdir -p "${gamelogdir}"; then +echo -en "creating console log [ ${italic}${consolelog}${default} ]" +if [ ! -f "${consolelog}" ]; then + if ! touch "${consolelog}"; then fn_print_fail_eol_nl core_exit.sh else fn_print_ok_eol_nl fi +else + fn_print_skip_eol_nl +fi + +if [ -n "${gamelogdir}" ]; then + echo -en "creating game log directory [ ${italic}${gamelogdir}${default} ]" + if [ ! -d "${gamelogdir}" ]; then + if ! mkdir -p "${gamelogdir}"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + else + fn_print_skip_eol_nl + fi fi # Symlink to gamelogdir # unless gamelogdir is within logdir. # e.g serverfiles/log is not within log/: symlink created # log/server is in log/: symlink not created -if [ "${gamelogdir}" ]; then - if [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ]; then - echo -en "creating symlink to game log dir: ${logdir}/server -> ${gamelogdir}..." +if [ -n "${gamelogdir}" ] && [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ]; then + echo -en "creating symlink to game log directory [ ${italic}${logdir}/server -> ${gamelogdir}${default} ]" + # if path does not exist or does not match gamelogdir + if [ ! -h "${logdir}/server" ] || [ "$(readlink -f "${logdir}/server")" != "${gamelogdir}" ]; then if ! ln -nfs "${gamelogdir}" "${logdir}/server"; then fn_print_fail_eol_nl core_exit.sh else fn_print_ok_eol_nl fi + else + fn_print_skip_eol_nl fi fi # If server uses SteamCMD create a symbolic link to the Steam logs. if [ -d "${HOME}/.steam/steam/logs" ]; then + echo -en "creating symlink to steam log directory [ ${italic}${logdir}/steam -> ${HOME}/.steam/steam/logs${default} ]" if [ ! -L "${logdir}/steam" ]; then - echo -en "creating symlink to steam log dir: ${logdir}/steam -> ${HOME}/.steam/steam/logs..." if ! ln -nfs "${HOME}/.steam/steam/logs" "${logdir}/steam"; then fn_print_fail_eol_nl core_exit.sh else fn_print_ok_eol_nl fi + else + fn_print_skip_eol_nl fi fi fn_script_log_info "Logs installed" diff --git a/lgsm/modules/install_mta_resources.sh b/lgsm/modules/install_mta_resources.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_retry.sh b/lgsm/modules/install_retry.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_server_dir.sh b/lgsm/modules/install_server_dir.sh old mode 100644 new mode 100755 index 2922f397a..318e4bc80 --- a/lgsm/modules/install_server_dir.sh +++ b/lgsm/modules/install_server_dir.sh @@ -10,10 +10,16 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${bold}${lightyellow}Server Directory${default}" fn_messages_separator +echo -en "creating serverfiles directory [ ${italic}${serverfiles}${default} ]" + if [ -d "${serverfiles}" ]; then - fn_print_warning_nl "A server is already installed here." + fn_print_skip_eol_nl + echo -e "" + echo -e "${italic}A game server is already exists at this location.${default}" +else + fn_print_ok_eol_nl fi -pwd + if [ -z "${autoinstall}" ]; then if ! fn_prompt_yn "Continue?" Y; then exitcode=0 @@ -21,5 +27,5 @@ if [ -z "${autoinstall}" ]; then fi fi if [ ! -d "${serverfiles}" ]; then - mkdir -v "${serverfiles}" + mkdir "${serverfiles}" fi diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh old mode 100644 new mode 100755 index baa18aef7..e5f10739d --- a/lgsm/modules/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -32,14 +32,7 @@ fn_install_server_files() { run="norun" force="noforce" md5="e3b4962cdd9d41e23c6fed65101bccde" - elif [ "${shortname}" == "bb" ]; then - remote_fileurl="http://linuxgsm.download/BrainBread/brainbread-v1.2-linuxserver.tar.xz" - local_filedir="${tmpdir}" - local_filename="brainbread-v1.2-linuxserver.tar.xz" - chmodx="nochmodx" - run="norun" - force="noforce" - md5="55f227183b736397806d5b6db6143f15" + elif [ "${shortname}" == "cod" ]; then remote_fileurl="http://linuxgsm.download/CallOfDuty/cod-lnxded-1.5b-full.tar.xz" local_filedir="${tmpdir}" @@ -80,14 +73,6 @@ fn_install_server_files() { run="norun" force="noforce" md5="2c6be1bb66ea631b9b2e7ae6216c6680" - elif [ "${shortname}" == "etl" ]; then - remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/etlegacy-v2.78.1-i386-et-260b.tar.xz" - local_filedir="${tmpdir}" - local_filename="etlegacy-v2.78.1-i386-et-260b.tar.xz" - chmodx="nochmodx" - run="norun" - force="noforce" - md5="7c08b52cb09b30eadb98ea05ef780fc7" elif [ "${shortname}" == "mohaa" ]; then remote_fileurl="http://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz" local_filedir="${tmpdir}" @@ -241,6 +226,10 @@ fn_install_server_files() { fn_clear_tmp } +if [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "ut" ]; then + install_eula.sh +fi + echo -e "" echo -e "${bold}${lightyellow}Installing ${gamename} Server${default}" fn_messages_separator @@ -255,12 +244,10 @@ fi if [ "${shortname}" == "ts3" ]; then update_ts3.sh elif [ "${shortname}" == "mc" ]; then - install_eula.sh update_mc.sh elif [ "${shortname}" == "mcb" ]; then update_mcb.sh elif [ "${shortname}" == "pmc" ]; then - install_eula.sh update_pmc.sh elif [ "${shortname}" == "wmc" ] || [ "${shortname}" == "vpmc" ]; then update_pmc.sh @@ -273,12 +260,16 @@ elif [ "${shortname}" == "jk2" ]; then update_jk2.sh elif [ "${shortname}" == "vints" ]; then update_vints.sh +elif [ "${shortname}" == "bb" ]; then + update_bb.sh elif [ "${shortname}" == "ut99" ]; then fn_install_server_files update_ut99.sh elif [ "${shortname}" == "xnt" ]; then update_xnt.sh -elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "bb" ] || [ "${shortname}" == "q4" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then +elif [ "${shortname}" == "etl" ]; then + update_etl.sh +elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "q4" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then if [ "${shortname}" == "ut" ]; then install_eula.sh fi @@ -287,7 +278,6 @@ fi if [ -z "${autoinstall}" ]; then echo -e "" - fn_messages_separator if ! fn_prompt_yn "Was the install successful?" Y; then install_retry.sh fi diff --git a/lgsm/modules/install_squad_license.sh b/lgsm/modules/install_squad_license.sh old mode 100644 new mode 100755 index 0bb71c4a8..7b7d2ca66 --- a/lgsm/modules/install_squad_license.sh +++ b/lgsm/modules/install_squad_license.sh @@ -14,7 +14,7 @@ echo -e "Server license is an optional feature for ${gamename} server" fn_script_log_info "Server license is an optional feature for ${gamename} server" echo -e "Get more info and a server license here:" -echo -e "https://squad.fandom.com/wiki/Server_licensing" +echo -e "${italic}https://squad.fandom.com/wiki/Server_licensing" fn_script_log_info "Get more info and a server license here:" fn_script_log_info "https://squad.fandom.com/wiki/Server_licensing" echo -e "" diff --git a/lgsm/modules/install_stats.sh b/lgsm/modules/install_stats.sh old mode 100644 new mode 100755 index fa43c280f..16653578b --- a/lgsm/modules/install_stats.sh +++ b/lgsm/modules/install_stats.sh @@ -13,6 +13,7 @@ fn_messages_separator echo -e "Assist LinuxGSM development by sending anonymous stats to developers." echo -e "Collected data is publicly available: ${italic}https://linuxgsm.com/data/usage${default}" echo -e "More info: ${italic}https://docs.linuxgsm.com/configuration/linuxgsm-stats${default}" +echo -e "" echo -e "The following info will be sent: " echo -e "* game server" echo -e "* distro" @@ -24,5 +25,6 @@ if [ -z "${autoinstall}" ]; then fn_print_information_nl "Stats setting is now enabled in common.cfg." fi else - fn_print_information_nl "auto-install leaves stats off by default. Stats can be enabled in common.cfg" + echo -e "" + echo -e "auto-install leaves stats off by default. Stats can be enabled in ${italic}common.cfg${default}" fi diff --git a/lgsm/modules/install_steamcmd.sh b/lgsm/modules/install_steamcmd.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_ts3db.sh b/lgsm/modules/install_ts3db.sh old mode 100644 new mode 100755 index c8f90a9cf..584fbd7c0 --- a/lgsm/modules/install_ts3db.sh +++ b/lgsm/modules/install_ts3db.sh @@ -11,8 +11,8 @@ fn_install_ts3db_mariadb() { if [ ! -f "${serverfiles}/libts3db_mariadb.so" ]; then echo -e "copying libmariadb.so.2...\c" cp "${serverfiles}/redist/libmariadb.so.2" "${serverfiles}" - local exitcode=$? - if [ "${exitcode}" != "0" ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "copying libmariadb.so.2" core_exit.sh diff --git a/lgsm/modules/install_ut2k4_key.sh b/lgsm/modules/install_ut2k4_key.sh old mode 100644 new mode 100755 index 7ffbba20c..4c62422d0 --- a/lgsm/modules/install_ut2k4_key.sh +++ b/lgsm/modules/install_ut2k4_key.sh @@ -12,13 +12,13 @@ echo -e "${bold}${lightyellow}Enter ${gamename} CD Key${default}" fn_messages_separator echo -e "To get your server listed on the Master Server list" echo -e "you must get a free CD key. Get a key here:" -echo -e "https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004" +echo -e "${italic}https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004" echo -e "" if [ -z "${autoinstall}" ]; then echo -e "Once you have the key enter it below" echo -n "KEY: " read -r CODE - echo -e ""\""CDKey"\""="\""${CODE}"\""" > "${systemdir}/cdkey" + printf '"CDKey"="%s"\n' "${CODE}" > "${systemdir}/cdkey" if [ -f "${systemdir}/cdkey" ]; then fn_script_log_info "UT2K4 Server CD Key created" fi @@ -27,3 +27,4 @@ else echo -e "./${selfname} server-cd-key" fi echo -e "" +core_exit.sh diff --git a/lgsm/modules/mods_core.sh b/lgsm/modules/mods_core.sh old mode 100644 new mode 100755 index 47bef26f7..bed0f9f49 --- a/lgsm/modules/mods_core.sh +++ b/lgsm/modules/mods_core.sh @@ -57,8 +57,8 @@ fn_mod_lowercase() { # Finally we can rename the file mv "${src}" "${dst}" # Exit if it fails for any reason - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl core_exit.sh fi @@ -74,8 +74,8 @@ fn_mod_create_filelist() { fn_sleep_time # ${modsdir}/${modcommand}-files.txt. find "${extractdest}" -mindepth 1 -printf '%P\n' > "${modsdir}/${modcommand}-files.txt" - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Building ${modsdir}/${modcommand}-files.txt" core_exit.sh @@ -94,8 +94,8 @@ fn_mod_copy_destination() { echo -en "copying ${modprettyname} to ${modinstalldir}..." fn_sleep_time cp -Rf "${extractdest}/." "${modinstalldir}/" - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Copying ${modprettyname} to ${modinstalldir}" else @@ -132,8 +132,8 @@ fn_mod_tidy_files_list() { # Delete line(s) matching exactly. sed -i "/^${removefilevar}$/d" "${modsdir}/${modcommand}-files.txt" # Exit on error. - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Error while tidying line: ${removefilevar} from: ${modsdir}/${modcommand}-files.txt" core_exit.sh @@ -197,14 +197,15 @@ fn_mod_get_info() { # Variable to know when job is done. modinfocommand="0" # Find entry in global array. - for ((index = 0; index <= ${#mods_global_array[@]}; index++)); do + for ((index = 0; index < ${#mods_global_array[@]}; index++)); do # When entry is found. if [ "${mods_global_array[index]}" == "${currentmod}" ]; then # Go back to the previous "MOD" separator. - for ((index = index; index <= ${#mods_global_array[@]}; index--)); do + for ((index_search = index; index_search >= 0; index_search--)); do # When "MOD" is found. - if [ "${mods_global_array[index]}" == "MOD" ]; then + if [ "${mods_global_array[index_search]}" == "MOD" ]; then # Get info. + index=${index_search} fn_mods_define modinfocommand="1" break @@ -249,7 +250,7 @@ fn_mods_define() { } # Builds list of installed mods. -# using installed-mods.txt grabing mod info from mods_list.sh. +# using installed-mods.txt grabbing mod info from mods_list.sh. fn_mods_installed_list() { fn_mods_count_installed # Set/reset variables. @@ -331,7 +332,7 @@ fn_compatible_mod_engines() { # How many engines we need to test. enginesamount=$(echo -e "${modengines}" | awk -F ';' '{ print NF }') # Test all subvalue of "modengines" using the ";" separator. - for ((gamevarindex = 1; gamevarindex < ${enginesamount}; gamevarindex++)); do + for ((gamevarindex = 1; gamevarindex < enginesamount; gamevarindex++)); do # Put current engine name into modtest variable. enginemodtest=$(echo -e "${modengines}" | awk -F ';' -v x=${gamevarindex} '{ print $x }') # If engine name matches. @@ -388,7 +389,7 @@ fn_create_mods_dir() { echo -en "creating LinuxGSM mods data directory ${modsdir}..." mkdir -p "${modsdir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Creating mod download dir ${modsdir}" core_exit.sh @@ -402,7 +403,7 @@ fn_create_mods_dir() { echo -en "creating mods install directory ${modinstalldir}..." mkdir -p "${modinstalldir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Creating mod install directory ${modinstalldir}" core_exit.sh @@ -425,7 +426,7 @@ fn_mods_create_tmp_dir() { mkdir -p "${modstmpdir}" exitcode=$? echo -en "creating mod download directory ${modstmpdir}..." - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Creating mod download directory ${modstmpdir}" core_exit.sh @@ -442,7 +443,7 @@ fn_mods_clear_tmp_dir() { echo -en "clearing mod download directory ${modstmpdir}..." rm -rf "${modstmpdir:?}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Clearing mod download directory ${modstmpdir}" core_exit.sh @@ -472,7 +473,7 @@ fn_mods_check_installed() { # Count installed mods. fn_mods_count_installed # If no mods are found. - if [ ${installedmodscount} -eq 0 ]; then + if [ "${installedmodscount}" -eq 0 ]; then echo -e "" fn_print_failure_nl "No installed mods or addons were found" echo -e " * Install mods using LinuxGSM first with: ./${selfname} mods-install" @@ -566,7 +567,7 @@ fn_mod_liblist_gam_filenames() { esac } -# modifers for liblist.gam to add/remote metamod binaries +# modifiers for liblist.gam to add/remote metamod binaries fn_mod_install_liblist_gam_file() { fn_mod_liblist_gam_filenames @@ -580,7 +581,7 @@ fn_mod_install_liblist_gam_file() { grep -q "addons/metamod/dlls/metamod.dll" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out. - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else @@ -596,7 +597,7 @@ fn_mod_install_liblist_gam_file() { grep -q "addons/metamod/dlls/metamod.so" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else @@ -614,11 +615,11 @@ fn_mod_install_liblist_gam_file() { grep -q "addons/metamod/dlls/metamod.dylib" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out. - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi fi @@ -638,11 +639,11 @@ fn_mod_remove_liblist_gam_file() { grep -q "${moddll}" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out. - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi @@ -654,11 +655,11 @@ fn_mod_remove_liblist_gam_file() { grep -q "${modso}" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi @@ -672,11 +673,11 @@ fn_mod_remove_liblist_gam_file() { grep -q "${moddylib}" "${modinstalldir}/liblist.gam" # if replacement back didn't happen, error out. exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi fi @@ -689,30 +690,24 @@ fn_mod_install_amxmodx_file() { # since it does exist, is the entry already in plugins.ini logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) inserted into ${modinstalldir}/addons/metamod/plugins.ini" echo -en "adding amxmodx_mm_i386.so in plugins.ini..." - grep -q "amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini" - exitcode=$? - if [ "${exitcode}" != 0 ]; then + if ! grep -q "amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini"; then # file exists but the entry does not, let's add it - echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> "${modinstalldir}/addons/metamod/plugins.ini" - exitcode=$? - if [ "${exitcode}" != 0 ]; then + if ! echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> "${modinstalldir}/addons/metamod/plugins.ini"; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi fi else # create new file and add the mod to it - echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > "${modinstalldir}/addons/metamod/plugins.ini" - exitcode=$? - if [ "${exitcode}" != 0 ]; then + if ! echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > "${modinstalldir}/addons/metamod/plugins.ini"; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl core_exit.sh else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi fi @@ -723,20 +718,18 @@ fn_mod_remove_amxmodx_file() { # since it does exist, is the entry already in plugins.ini logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) removed from ${modinstalldir}/addons/metamod/plugins.ini" echo -en "removing amxmodx_mm_i386.so in plugins.ini..." - grep -q "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini" - # iIs it found? If so remove it and clean up - exitcode=$? - if [ "${exitcode}" == 0 ]; then + # is it found? If so remove it and clean up + if grep -q "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini"; then # delete the line we inserted sed -i '/linux addons\/amxmodx\/dlls\/amxmodx_mm_i386.so/d' "${modinstalldir}/addons/metamod/plugins.ini" # remove empty lines sed -i '/^$/d' "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi diff --git a/lgsm/modules/mods_list.sh b/lgsm/modules/mods_list.sh old mode 100644 new mode 100755 index d6622d1b2..b3f9877f1 --- a/lgsm/modules/mods_list.sh +++ b/lgsm/modules/mods_list.sh @@ -55,13 +55,13 @@ amxxtslatestfile="amxmodx-${amxxtsversion}-${amxxtsmod}-linux.tar.gz" amxxtsdownloadurl="https://www.amxmodx.org/release/${amxxtslatestfile}" amxxtsurl="${amxxtsdownloadurl}" # Metamod:Source -metamodsourceversion="1.11" +metamodsourceversion="1.12" metamodsourcescrapeurl="https://mms.alliedmods.net/mmsdrop/${metamodsourceversion}/mmsource-latest-linux" metamodsourcelatestfile=$(wget "${metamodsourcescrapeurl}" -q -O -) metamodsourcedownloadurl="https://www.metamodsource.net/latest.php?os=linux&version=${metamodsourceversion}" metamodsourceurl="${metamodsourcedownloadurl}" # Sourcemod -sourcemodversion="1.11" +sourcemodversion="1.13" sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodversion}/sourcemod-latest-linux" sourcemodlatestfile=$(wget "${sourcemodscrapeurl}" -q -O -) sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${sourcemodversion}" @@ -129,7 +129,7 @@ modseparator="MOD" # [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 +# [12] | "AUTHOR_URL" is the author's website, displayed to the user when choosing mods to install # [13] | "Short Description" a description showed to the user upon installation/removal # Half-life 1 Engine Mods @@ -172,7 +172,7 @@ mod_info_ulib=(MOD "ulib" "ULib" "https://codeload.github.com/TeamUlysses/ulib/z 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=(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 Weapons & Engines") mod_info_acf_missiles=(MOD "acfmissiles" "ACF Missiles" "https://github.com/Bubbus/ACF-Missiles/archive/master.zip" "acf-missiles-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Bubbus/ACF-Missiles" "More missiles for ACF") mod_info_advdupe2=(MOD "advdupe2" "Advanced Duplicator 2" "https://github.com/wiremod/advdupe2/archive/master.zip" "advdupe2-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://www.wiremod.com" "Save your constructions. Second version") mod_info_pac3=(MOD "pac3" "PAC3" "https://github.com/CapsAdmin/pac3/archive/master.zip" "pac3-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/CapsAdmin/pac3" "Advanced player model customization") @@ -189,10 +189,9 @@ mod_info_spinnertool=(MOD "spinnertool" "Spinner Tool" "https://github.com/dvdvi mod_info_surfacefrictiontool=(MOD "surfacefrictiontool" "Surface Friction Tool" "https://github.com/dvdvideo1234/surfacefrictiontool/archive/master.zip" "surfacefrictiontool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/SurfaceFrictionTool" "Controls the surface friction of a prop") mod_info_magneticdipole=(MOD "magneticdipole" "Magnetic Dipole" "https://github.com/dvdvideo1234/magneticdipole/archive/master.zip" "magneticdipole-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/MagneticDipole" "Magnet entity that runs forces on its poles. Supports wire") mod_info_environmentorganizer=(MOD "environmentorganizer" "Environment Organizer" "https://github.com/dvdvideo1234/environmentorganizer/archive/master.zip" "environmentorganizer-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/EnvironmentOrganizer" "Installs routines designed for server settings adjustment") -mod_info_precision_alignment=(MOD "precision-alignment" "Precision Alignment" "https://github.com/Mista-Tea/precision-alignment/archive/master.zip" "precision-alignment-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/precision-alignment" "Creates precise constraints and aligments") mod_info_improved_stacker=(MOD "improved-stacker" "Improved Stacker" "https://github.com/Mista-Tea/improved-stacker/archive/master.zip" "improved-stacker-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-stacker" "Stacks entities in the direction chosen") mod_info_improved_weight=(MOD "improved-weight" "Improved Weight" "https://github.com/Mista-Tea/improved-weight/archive/master.zip" "improved-weight-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-weight" "Weight tool but with more features") -mod_info_improved_antinoclip=(MOD "improved-antinoclip" "Improved Antinoclip" "https://github.com/Mista-Tea/improved-antinoclip/archive/master.zip" "improved-antinoclip-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-antinoclip" "Controls clipping trough an object") +mod_info_improved_antinoclip=(MOD "improved-antinoclip" "Improved Antinoclip" "https://github.com/Mista-Tea/improved-antinoclip/archive/master.zip" "improved-antinoclip-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-antinoclip" "Controls clipping through an object") mod_info_darkrp=(MOD "darkrp" "DarkRP" "https://github.com/FPtje/DarkRP/archive/master.zip" "darkrp-master.zip" "0" "LowercaseOn" "${systemdir}/gamemodes" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Most popular gamemode") mod_info_darkrpmodification=(MOD "darkrpmodification" "DarkRP Modification" "https://github.com/FPtje/darkrpmodification/archive/master.zip" "darkrpmodification-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "NOUPDATE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Customize DarkRP settings") mod_info_laserstool=(MOD "laserstool" "Laser STool" "https://github.com/dvdvideo1234/laserstool/archive/main.zip" "laserstool-main.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/LaserSTool" "Scripted tool that spawns laser entities, simulates light rays and even kill players") diff --git a/lgsm/modules/query_gamedig.sh b/lgsm/modules/query_gamedig.sh old mode 100644 new mode 100755 index f370fae97..1fa74a823 --- a/lgsm/modules/query_gamedig.sh +++ b/lgsm/modules/query_gamedig.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Querys a gameserver using node-gamedig. +# Description: Queries a gameserver using node-gamedig. # https://github.com/gamedig/node-gamedig moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" @@ -42,9 +42,7 @@ if [ "$(command -v "${gamedigbinary}" 2> /dev/null)" ] && [ "$(command -v jq 2> fi # numplayers. - if [ "${querytype}" == "minecraft" ]; then - gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length-1') - elif [ "${querytype}" == "teamspeak3" ]; then + if [ "${querytype}" == "teamspeak3" ]; then gdplayers=$(echo "${gamedigraw}" | jq -re '.raw.virtualserver_clientsonline') else gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length') diff --git a/lgsm/modules/query_gsquery.py b/lgsm/modules/query_gsquery.py index ecdf8165c..c4b8c3ddc 100644 --- a/lgsm/modules/query_gsquery.py +++ b/lgsm/modules/query_gsquery.py @@ -6,154 +6,206 @@ # Website: https://linuxgsm.com # Description: Allows querying of various game servers. +"""Query game servers using a set of lightweight UDP protocols.""" + import argparse import socket import sys -engine_types = ('protocol-valve', 'protocol-quake2', 'protocol-quake3', 'protocol-gamespy1', - 'protocol-unreal2', 'ut3', 'minecraft', 'minecraftbe', 'jc2m', 'mumbleping', 'soldat', 'teeworlds') +engine_types = ( + "protocol-valve", + "protocol-quake2", + "protocol-quake3", + "protocol-gamespy1", + "protocol-unreal2", + "ut3", + "minecraft", + "minecraftbe", + "jc2m", + "mumbleping", + "soldat", + "teeworlds", +) + +class GSQuery: + """Game server query dispatcher.""" -class gsquery: server_response_timeout = 2 default_buffer_length = 1024 - sourcequery = ('protocol-valve', 'avalanche3.0', 'barotrauma', 'madness', 'quakelive', 'realvirtuality', - 'refractor', 'source', 'goldsrc', 'spark', 'starbound', 'unity3d', 'unreal4', 'wurm') - idtech2query = ('protocol-quake2', 'idtech2', 'quake', 'iw2.0') - idtech3query = ('protocol-quake3', 'iw3.0', 'ioquake3', 'qfusion') - minecraftquery = ('minecraft', 'lwjgl2') - minecraftbequery = ('minecraftbe',) - jc2mquery = ('jc2m',) - mumblequery = ('mumbleping',) - soldatquery = ('soldat',) - twquery = ('teeworlds',) - unrealquery = ('protocol-gamespy1', 'unreal') - unreal2query = ('protocol-unreal2', 'unreal2') - unreal3query = ('ut3', 'unreal3') + sourcequery = ( + "protocol-valve", + "avalanche3.0", + "barotrauma", + "madness", + "quakelive", + "realvirtuality", + "refractor", + "source", + "goldsrc", + "spark", + "starbound", + "unity3d", + "unreal4", + "wurm", + ) + idtech2query = ("protocol-quake2", "idtech2", "quake", "iw2.0") + idtech3query = ("protocol-quake3", "iw3.0", "ioquake3", "qfusion") + minecraftquery = ("minecraft", "lwjgl2") + minecraftbequery = ("minecraftbe",) + jc2mquery = ("jc2m",) + mumblequery = ("mumbleping",) + soldatquery = ("soldat",) + twquery = ("teeworlds",) + unrealquery = ("protocol-gamespy1", "unreal") + unreal2query = ("protocol-unreal2", "unreal2") + unreal3query = ("ut3", "unreal3") def __init__(self, arguments): + """Create a query instance from parsed CLI args.""" + self.argument = arguments # if self.argument.engine in self.sourcequery: - self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' + self.query_prompt_string = b"\xff\xff\xff\xffTSource Engine Query\0" elif self.argument.engine in self.idtech2query: - self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00' + self.query_prompt_string = b"\xff\xff\xff\xffstatus\x00" elif self.argument.engine in self.idtech3query: - self.query_prompt_string = b'\xff\xff\xff\xffgetstatus' + self.query_prompt_string = b"\xff\xff\xff\xffgetstatus" elif self.argument.engine in self.jc2mquery: - self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40' + self.query_prompt_string = b"\xfe\xfd\x09\x10\x20\x30\x40" elif self.argument.engine in self.minecraftquery: - self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93' + self.query_prompt_string = b"\xfe\xfd\x09\x3d\x54\x1f\x93" elif self.argument.engine in self.minecraftbequery: - self.query_prompt_string = b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78\x00\x00\x00\x00\x00\x00\x00\x00' + self.query_prompt_string = ( + b"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00" + b"\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78" + b"\x00\x00\x00\x00\x00\x00\x00\x00" + ) elif self.argument.engine in self.mumblequery: - self.query_prompt_string = b'\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08' + self.query_prompt_string = ( + b"\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08" + ) elif self.argument.engine in self.soldatquery: - self.query_prompt_string = b'\x69\x00' + self.query_prompt_string = b"\x69\x00" elif self.argument.engine in self.twquery: - self.query_prompt_string = b'\x04\x00\x00\xff\xff\xff\xff\x05' + \ - bytearray(511) + self.query_prompt_string = b"\x04\x00\x00\xff\xff\xff\xff\x05" + bytearray( + 511 + ) elif self.argument.engine in self.unrealquery: - self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C' + self.query_prompt_string = b"\x5c\x69\x6e\x66\x6f\x5c" elif self.argument.engine in self.unreal2query: - self.query_prompt_string = b'\x79\x00\x00\x00\x00' + self.query_prompt_string = b"\x79\x00\x00\x00\x00" elif self.argument.engine in self.unreal3query: - self.query_prompt_string = b'\xFE\xFD\x09\x00\x00\x00\x00' + self.query_prompt_string = b"\xfe\xfd\x09\x00\x00\x00\x00" self.connected = False self.response = None @staticmethod def fatal_error(error_message, error_code=1): - sys.stderr.write('ERROR: ' + str(error_message) + '\n') + """Write an error message to stderr and exit.""" + + sys.stderr.write("ERROR: " + str(error_message) + "\n") sys.exit(error_code) @staticmethod - def exit_success(success_message=''): - sys.stdout.write('OK: ' + str(success_message) + '\n') + def exit_success(success_message=""): + """Write a success message to stdout and exit.""" + + sys.stdout.write("OK: " + str(success_message) + "\n") sys.exit(0) def responding(self): + """Send a single UDP query and print the response.""" + # Connect. connection = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) connection.settimeout(self.server_response_timeout) try: self.connected = connection.connect( - (self.argument.address, int(self.argument.port))) + (self.argument.address, int(self.argument.port)) + ) except socket.timeout: - self.fatal_error('Request timed out', 1) - except Exception: - self.fatal_error('Unable to connect', 1) + self.fatal_error("Request timed out", 1) + except OSError: + self.fatal_error("Unable to connect", 1) # Send. connection.send(self.query_prompt_string) # Receive. try: self.response = connection.recv(self.default_buffer_length) except socket.error: - self.fatal_error('Unable to receive', 2) + self.fatal_error("Unable to receive", 2) connection.close() # Response. if self.response is None: - self.fatal_error('No response', 3) + self.fatal_error("No response", 3) if len(self.response) < 5: - sys.exit('Short response.', 3) + sys.exit("Short response.", 3) else: self.exit_success(str(self.response)) def parse_args(): + """Parse command-line arguments.""" + parser = argparse.ArgumentParser( - description='Allows querying of various game servers.', - usage='usage: python3 %(prog)s [options]', - add_help=False + description="Allows querying of various game servers.", + usage="usage: python3 %(prog)s [options]", + add_help=False, ) parser.add_argument( - '-a', '--address', + "-a", + "--address", type=str, required=True, - help='The IPv4 address of the server.' + help="The IPv4 address of the server.", ) parser.add_argument( - '-p', '--port', + "-p", + "--port", type=int, required=True, - help='The IPv4 port of the server.' + help="The IPv4 port of the server.", ) parser.add_argument( - '-e', '--engine', - metavar='ENGINE', + "-e", + "--engine", + metavar="ENGINE", choices=engine_types, - help='Engine type: ' + ' '.join(engine_types) + help="Engine type: " + " ".join(engine_types), ) parser.add_argument( - '-v', '--verbose', - action='store_true', - help='Display verbose output.' + "-v", + "--verbose", + action="store_true", + help="Display verbose output.", ) parser.add_argument( - '-d', '--debug', - action='store_true', - help='Display debugging output.' + "-d", + "--debug", + action="store_true", + help="Display debugging output.", ) parser.add_argument( - '-V', '--version', - action='version', - version='%(prog)s 0.0.1', - help='Display version and exit.' - ) - parser.add_argument( - '-h', '--help', - action='help', - help='Display help and exit.' + "-V", + "--version", + action="version", + version="%(prog)s 0.0.1", + help="Display version and exit.", ) + parser.add_argument("-h", "--help", action="help", help="Display help and exit.") return parser.parse_args() def main(): + """CLI entrypoint.""" + arguments = parse_args() - server = gsquery(arguments) + server = GSQuery(arguments) server.responding() -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/lgsm/modules/update_bb.sh b/lgsm/modules/update_bb.sh new file mode 100644 index 000000000..1f2f12ce8 --- /dev/null +++ b/lgsm/modules/update_bb.sh @@ -0,0 +1,175 @@ +#!/bin/bash +# LinuxGSM update_bb.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of BrainBread servers. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_dl() { + # Download and extract files to serverfiles. + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}" + fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" + echo "${remotebuild}" > "${serverfiles}/build.txt" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses build file to get local build. + localbuild=$(head -n 1 "${serverfiles}/build.txt" 2> /dev/null) + if [ -z "${localbuild}" ]; then + fn_print_error "Checking local build: ${remotelocation}: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" + localbuild="0" + else + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_remotebuild() { + # Gets remote build info. + apiurl="https://api.github.com/repos/IronOak-Studios/BrainBread/releases/latest" + remotebuildresponse=$(curl -s "${apiurl}") + remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[] | select(.name | test("linuxserver\\.tar\\.gz$")) | .name' | head -n 1) + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[] | select(.name | test("linuxserver\\.tar\\.gz$")) | .browser_download_url' | head -n 1) + remotebuildhash=$(echo "${remotebuildresponse}" | jq -r '.assets[] | select(.name | test("linuxserver\\.tar\\.gz$")) | .digest' | sed 's/^sha256://g' | head -n 1) + remotebuild=$(echo "${remotebuildresponse}" | jq -r '.tag_name') + if [ -z "${remotebuildhash}" ] || [ "${remotebuildhash}" == "null" ]; then + remotebuildhash="nohash" + fi + + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ] || [ -z "${remotebuildurl}" ] || [ "${remotebuildurl}" == "null" ] || [ -z "${remotebuildfilename}" ] || [ "${remotebuildfilename}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fail "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ] || [ -z "${remotebuildurl}" ] || [ "${remotebuildurl}" == "null" ] || [ -z "${remotebuildfilename}" ] || [ "${remotebuildfilename}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_compare() { + fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" + fn_print_ok_nl "Checking for update: ${remotelocation}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + fn_print_nl "* Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuildhash: ${remotebuildhash}" + fn_print_nl "* remotebuild: ${remotebuild}" + fi + fn_print "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuild}" + + if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir:?}/last-updated.lock" + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + fn_sleep_time_5 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" + fi + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + fn_print_nl "* Branch: ${branch}" + fi + fn_print "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuildhash: ${remotebuildhash}" + fn_print_nl "* remotebuild: ${remotebuild}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="github.com" + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_remotebuild + fn_update_dl +else + # BrainBread requires both Steam app updates and GitHub package updates. + update_steamcmd.sh + + fn_print_dots "Checking for update" + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_localbuild + fn_update_remotebuild + fn_update_compare +fi diff --git a/lgsm/modules/update_etl.sh b/lgsm/modules/update_etl.sh new file mode 100755 index 000000000..8486343e2 --- /dev/null +++ b/lgsm/modules/update_etl.sh @@ -0,0 +1,173 @@ +#!/bin/bash +# LinuxGSM update_etl.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of ET: Legacy servers. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_dl() { + # Download and extract files to serverfiles. + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}" + fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" + echo "${remotebuild}" > "${serverfiles}/build.txt" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Try to get build version from etconsole.log. + if [ -f "${gamelogdir}/etconsole.log" ]; then + localbuild=$(grep "Initializing legacy game" "${gamelogdir}/etconsole.log" | sed -n 's/.*\^2\(v[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p' | tail -1) + fi + # Fall back to build.txt if log parse failed or log does not exist. + if [ -z "${localbuild}" ]; then + localbuild=$(head -n 1 "${serverfiles}/build.txt" 2> /dev/null) + fi + if [ -z "${localbuild}" ]; then + fn_print_error "Checking local build: ${remotelocation}: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" + localbuild="0" + else + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_remotebuild() { + # Gets remote build info. + apiurl="https://api.github.com/repos/GameServerManagers/etlserver-build/releases/latest" + remotebuildresponse=$(curl -s "${apiurl}") + remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[] | select(.browser_download_url | contains("i386-et-260b")) | .name') + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[] | select(.browser_download_url | contains("i386-et-260b")) | .browser_download_url') + remotebuild=$(echo "${remotebuildresponse}" | jq -r '.tag_name') + remotebuildhash=$(echo "${remotebuildresponse}" | jq -r '.body' | grep 'MD5' | grep -oE '[a-f0-9]{32}') + + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fail "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_compare() { + fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" + fn_print_ok_nl "Checking for update: ${remotelocation}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + fn_print_nl "* Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" + fi + fn_print "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuild}" + + if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir:?}/last-updated.lock" + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + fn_sleep_time_5 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" + fi + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + fn_print_nl "* Branch: ${branch}" + fi + fn_print "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="github.com" + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_remotebuild + fn_update_dl +else + fn_print_dots "Checking for update" + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_localbuild + fn_update_remotebuild + fn_update_compare +fi diff --git a/lgsm/modules/update_fctr.sh b/lgsm/modules/update_fctr.sh old mode 100644 new mode 100755 index b49386654..5de789cdb --- a/lgsm/modules/update_fctr.sh +++ b/lgsm/modules/update_fctr.sh @@ -10,41 +10,48 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "nohash" - fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuildversion}.tar.xz" "${serverfiles}" "factorio" + fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuild}.tar.xz" "${serverfiles}" "factorio" fn_clear_tmp } fn_update_localbuild() { - # Gets local build info. - fn_print_dots "Checking local build: ${remotelocation}" + # Optional arg1: 'silent' to suppress user-facing output + local mode="${1:-}" + if [ "${mode}" != "silent" ]; then + fn_print_dots "Checking local build: ${remotelocation}" + fi # Uses executable to get local build. if [ -d "${executabledir}" ]; then cd "${executabledir}" || exit localbuild=$(${executable} --version | grep -m 1 "Version:" | awk '{print $2}') fi if [ -z "${localbuild}" ]; then - fn_print_error "Checking local build: ${remotelocation}: missing local build info" + if [ "${mode}" != "silent" ]; then + fn_print_error "Checking local build: ${remotelocation}: missing local build info" + fi fn_script_log_error "Missing local build info" fn_script_log_error "Set localbuild to 0" localbuild="0" else - fn_print_ok "Checking local build: ${remotelocation}" + if [ "${mode}" != "silent" ]; then + fn_print_ok "Checking local build: ${remotelocation}" + fi fn_script_log_pass "Checking local build" fi } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://factorio.com/get-download/${branch}/headless/${factorioarch}" remotebuildresponse=$(curl -s "${apiurl}") - remotebuildversion=$(echo "${remotebuildresponse}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1) + remotebuild=$(echo "${remotebuildresponse}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1) remotebuildurl="https://factorio.com/get-download/${branch}/headless/${factorioarch}" - remotebuildfilename="factorio_headless_${factorioarch}-${remotebuildversion}.tar.xz" + remotebuildfilename="factorio_headless_${factorioarch}-${remotebuild}.tar.xz" if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -54,7 +61,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -65,35 +72,37 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild} ${factorioarch}${default}" - echo -e "* Remote build: ${green}${remotebuildversion} ${factorioarch}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild} ${factorioarch}" - fn_script_log_info "Remote build: ${remotebuildversion} ${factorioarch}" + fn_script_log_info "Remote build: ${remotebuild} ${factorioarch}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + # Keep track of the build before updating for alert purposes. + previousbuild="${localbuild}" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -120,6 +129,23 @@ fn_update_compare() { command_start.sh fn_firstcommand_reset fi + # Refresh local build value after update (silent) so alerts show new version. + fn_update_localbuild silent + # Verify the update applied correctly unless forced update to same version. + if [ "${localbuild}" != "${remotebuild}" ]; then + # If forced update and version unchanged treat as acceptable; otherwise failure. + if [ "${forceupdate}" != "1" ] || [ "${previousbuild}" = "${localbuild}" ]; then + fn_script_log_error "Update verification failed: expected ${remotebuild}, got ${localbuild}" + fn_print_fail_nl "Update verification failed: expected ${remotebuild}, got ${localbuild}" + updatefailureexpected="${remotebuild}" + updatefailuregot="${localbuild}" + alert="update-failed" + alert.sh + core_exit.sh + fi + else + fn_script_log_pass "Update verification success: ${previousbuild} -> ${localbuild}" + fi unset exitbypass alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then @@ -128,26 +154,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild} ${factorioarch}${default}" - echo -e "* Remote build: ${green}${remotebuildversion} ${factorioarch}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild} ${factorioarch}" - fn_script_log_info "Remote build: ${remotebuildversion} ${factorioarch}" + fn_script_log_info "Remote build: ${remotebuild} ${factorioarch}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } diff --git a/lgsm/modules/update_jk2.sh b/lgsm/modules/update_jk2.sh old mode 100644 new mode 100755 index ed4886a48..ee40988d9 --- a/lgsm/modules/update_jk2.sh +++ b/lgsm/modules/update_jk2.sh @@ -31,17 +31,17 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://api.github.com/repos/mvdevs/jk2mv/releases/latest" remotebuildresponse=$(curl -s "${apiurl}") remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("dedicated.zip")) | .name') remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("dedicated.zip")) | .browser_download_url') - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.tag_name') + remotebuild=$(echo "${remotebuildresponse}" | jq -r '.tag_name') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -51,7 +51,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -62,34 +62,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -117,7 +118,6 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" @@ -125,26 +125,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh old mode 100644 new mode 100755 index 6ece44da4..81540f002 --- a/lgsm/modules/update_mc.sh +++ b/lgsm/modules/update_mc.sh @@ -34,29 +34,29 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://launchermeta.mojang.com/mc/game/version_manifest.json" remotebuildresponse=$(curl -s "${apiurl}") # Latest release. if [ "${branch}" == "release" ] && [ "${mcversion}" == "latest" ]; then - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.latest.release') + remotebuild=$(echo "${remotebuildresponse}" | jq -r '.latest.release') # Latest snapshot. elif [ "${branch}" == "snapshot" ] && [ "${mcversion}" == "latest" ]; then - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.latest.snapshot') + remotebuild=$(echo "${remotebuildresponse}" | jq -r '.latest.snapshot') # Specific release/snapshot. else - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r --arg branch "${branch}" --arg mcversion "${mcversion}" '.versions | .[] | select(.type==$branch and .id==$mcversion) | .id') + remotebuild=$(echo "${remotebuildresponse}" | jq -r --arg branch "${branch}" --arg mcversion "${mcversion}" '.versions | .[] | select(.type==$branch and .id==$mcversion) | .id') fi - remotebuildfilename="minecraft_server.${remotebuildversion}.jar" + remotebuildfilename="minecraft_server.${remotebuild}.jar" # Generate link to version manifest json. - remotebuildmanifest=$(echo "${remotebuildresponse}" | jq -r --arg branch "${branch}" --arg mcversion "${remotebuildversion}" '.versions | .[] | select(.type==$branch and .id==$mcversion) | .url') + remotebuildmanifest=$(echo "${remotebuildresponse}" | jq -r --arg branch "${branch}" --arg mcversion "${remotebuild}" '.versions | .[] | select(.type==$branch and .id==$mcversion) | .url') # Generate link to server.jar remotebuildurl=$(curl -s "${remotebuildmanifest}" | jq -r '.downloads.server.url') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -66,7 +66,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -77,35 +77,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -140,26 +140,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh old mode 100644 new mode 100755 index 65ebc2546..9940415a1 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -8,15 +8,15 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuildversion}.zip" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip" "nochmodx" "norun" "noforce" "nohash" echo -e "Extracting to ${serverfiles}...\c" if [ "${firstcommandname}" == "INSTALL" ]; then - unzip -oq "${tmpdir}/bedrock_server.${remotebuildversion}.zip" -x "server.properties" -d "${serverfiles}" + unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "server.properties" -d "${serverfiles}" else - unzip -oq "${tmpdir}/bedrock_server.${remotebuildversion}.zip" -x "permissions.json" "server.properties" "allowlist.json" -d "${serverfiles}" + unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "permissions.json" "server.properties" "allowlist.json" -d "${serverfiles}" fi - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Extracting ${local_filename}" if [ -f "${lgsmlog}" ]; then @@ -27,7 +27,9 @@ fn_update_dl() { core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "Extracting ${local_filename}" + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Extracting ${local_filename}" + fi fn_clear_tmp fi } @@ -36,7 +38,7 @@ fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses log file to get local build. - localbuild=$(grep Version "${consolelogdir}"/* 2> /dev/null | tail -1 | sed 's/.*Version: //' | tr -d '\000-\011\013-\037') + localbuild=$(grep -hoP 'Version:\s*\K[\d.]+' "${consolelogdir}"/* 2> /dev/null | sort -V -r | head -n1) if [ -z "${localbuild}" ]; then fn_print_error "Checking local build: ${remotelocation}: missing local build info" fn_script_log_error "Missing local build info" @@ -49,20 +51,23 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Random number for userAgent - randomint=$(tr -dc 0-9 < /dev/urandom 2> /dev/null | head -c 4 | xargs) - # Get remote build info. - if [ "${mcversion}" == "latest" ]; then - remotebuildversion=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randomint}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://www.minecraft.net/bedrockdedicatedserver/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") + # Gets remote build info. + apiurl="https://net-secondary.web.minecraft-services.net/api/v1.0/download/links" + remotebuildresponse=$(curl -s "${apiurl}" | jq '.result.links[]') + # Latest preview. + if [ "${mcversion}" == "preview" ]; then + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r 'select(.downloadType == "serverBedrockPreviewLinux") | .downloadUrl') + # Latest release. else - remotebuildversion="${mcversion}" + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r 'select(.downloadType == "serverBedrockLinux") | .downloadUrl') fi - remotebuildurl="https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-${remotebuildversion}.zip" + remotebuild=$(echo "${remotebuildurl}" | grep -Eo "[.0-9]+[0-9]") + remotebuildfilename="bedrock-server-${remotebuild}.zip" if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -72,7 +77,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -83,35 +88,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -146,26 +151,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } diff --git a/lgsm/modules/update_mta.sh b/lgsm/modules/update_mta.sh old mode 100644 new mode 100755 index b93dc9af1..b1ba0459c --- a/lgsm/modules/update_mta.sh +++ b/lgsm/modules/update_mta.sh @@ -34,16 +34,16 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://linux.multitheftauto.com/revision/latest.txt" remotebuildresponse=$(curl -s "${apiurl}") remotebuildfilename="multitheftauto_linux_x64.tar.gz" remotebuildurl="http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" - remotebuildversion=$(echo "${remotebuildresponse}") + remotebuild="${remotebuildresponse}" if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -53,7 +53,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -64,7 +64,7 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" if [ "${forceupdate}" == "1" ]; then @@ -74,30 +74,31 @@ fn_update_compare() { mtaupdatestatus="available" fi fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -125,7 +126,6 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" @@ -133,26 +133,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh old mode 100644 new mode 100755 index b3c7d0dc2..9273a567a --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -5,13 +5,13 @@ # Website: https://linuxgsm.com # Description: Handles updating of PaperMC and Waterfall servers. -module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "chmodx" "norun" "force" "${remotebuildhash}" cp -f "${tmpdir}/${remotebuildfilename}" "${serverfiles}/${executable#./}" - echo "${remotebuildversion}" > "${serverfiles}/build.txt" + echo "${remotebuild}" > "${serverfiles}/build.txt" fn_clear_tmp } @@ -32,18 +32,19 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. - apiurl="https://papermc.io/api/v2/projects" + jq_versions_all='.versions | to_entries | map(.value[])' + # Gets remote build info. + apiurl="https://fill.papermc.io/v3/projects" # Get list of projects. remotebuildresponse=$(curl -s "${apiurl}") # Get list of Minecraft versions for project. remotebuildresponseproject=$(curl -s "${apiurl}/${paperproject}") # Get latest Minecraft: Java Edition version or user specified version. if [ "${mcversion}" == "latest" ]; then - remotebuildmcversion=$(echo "${remotebuildresponseproject}" | jq -r '.versions[-1]') + remotebuildmcversion=$(echo "${remotebuildresponseproject}" | jq -r "$jq_versions_all | first") else # Checks if user specified version exists. - remotebuildmcversion=$(echo "${remotebuildresponseproject}" | jq -r -e --arg mcversion "${mcversion}" '.versions[]|select(. == $mcversion)') + remotebuildmcversion=$(echo "${remotebuildresponseproject}" | jq -r -e --arg mcversion "${mcversion}" "$jq_versions_all | .[] | select(. == \$mcversion)") if [ -z "${remotebuildmcversion}" ]; then # user passed version does not exist fn_print_error_nl "Version ${mcversion} not available from ${remotelocation}" @@ -54,19 +55,19 @@ fn_update_remotebuild() { # Get list of paper builds for specific Minecraft: Java Edition version. remotebuildresponsemcversion=$(curl -s "${apiurl}/${paperproject}/versions/${remotebuildmcversion}") # Get latest paper build for specific Minecraft: Java Edition version. - remotebuildpaperversion=$(echo "${remotebuildresponsemcversion}" | jq -r '.builds[-1]') + remotebuildpaperversion=$(echo "${remotebuildresponsemcversion}" | jq -r '.builds[0]') # Get various info about the paper build. remotebuildresponseversion=$(curl -s "${apiurl}/${paperproject}/versions/${remotebuildmcversion}/builds/${remotebuildpaperversion}") - remotebuildfilename=$(echo "${remotebuildresponseversion}" | jq -r '.downloads.application.name') - remotebuildhash=$(echo "${remotebuildresponseversion}" | jq -r '.downloads.application.sha256') - remotebuildurl="${apiurl}/${paperproject}/versions/${remotebuildmcversion}/builds/${remotebuildpaperversion}/downloads/${remotebuildfilename}" + remotebuildfilename=$(echo "${remotebuildresponseversion}" | jq -r '.downloads["server:default"].name') + remotebuildhash=$(echo "${remotebuildresponseversion}" | jq -r '.downloads["server:default"].checksums.sha256') + remotebuildurl=$(echo "${remotebuildresponseversion}" | jq -r '.downloads["server:default"].url') # Combines Minecraft: Java Edition version and paper build. e.g 1.16.5-456 - remotebuildversion="${remotebuildmcversion}-${remotebuildpaperversion}" + remotebuild="${remotebuildmcversion}-${remotebuildpaperversion}" if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -76,7 +77,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -87,35 +88,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -150,26 +151,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } diff --git a/lgsm/modules/update_steamcmd.sh b/lgsm/modules/update_steamcmd.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh old mode 100644 new mode 100755 index 30ddf2801..ec3bc0060 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -31,7 +31,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://www.teamspeak.com/versions/server.json" remotebuildresponse=$(curl -s "${apiurl}") @@ -43,12 +43,12 @@ fn_update_remotebuild() { remotebuildhash=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86.checksum') fi remotebuildfilename=$(basename "${remotebuildurl}") - remotebuildversion=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86_64.version') + remotebuild=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86_64.version') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -58,7 +58,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -69,35 +69,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -132,26 +132,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh old mode 100644 new mode 100755 index cb74ec3b7..4e3f93b31 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -5,13 +5,13 @@ # Website: https://linuxgsm.com # Description: Handles updating of Unreal Tournament 99 servers. -module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "nohash" fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" - echo "${remotebuildversion}" > "${serverfiles}/build.txt" + echo "${remotebuild}" > "${serverfiles}/build.txt" fn_clear_tmp } @@ -32,17 +32,17 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://api.github.com/repos/OldUnreal/UnrealTournamentPatches/releases/latest" remotebuildresponse=$(curl -s "${apiurl}") remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .name') remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .browser_download_url') - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.tag_name') + remotebuild=$(echo "${remotebuildresponse}" | jq -r '.tag_name') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -52,7 +52,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -63,35 +63,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -126,26 +126,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh old mode 100644 new mode 100755 index 2f7f857a1..5bf3df25d --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -20,6 +20,7 @@ fn_update_localbuild() { # Uses executable to get local build. if [ -d "${executabledir}" ]; then cd "${executabledir}" || exit + # shellcheck disable=SC2086 # Intentional: preexecutable may be empty; unquoted to drop it without producing an empty arg. localbuild="$(${preexecutable} ${executable} --version 2> /dev/null | sed '/^[[:space:]]*$/d')" fi if [ -z "${localbuild}" ]; then @@ -34,22 +35,24 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="http://api.vintagestory.at/stable-unstable.json" remotebuildresponse=$(curl -s "${apiurl}") if [ "${branch}" == "stable" ]; then - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1) + remotebuild=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1) + elif [ "${branch}" == "unstable" ]; then + remotebuild=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1) else - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1) + remotebuild="${branch}" fi - remotebuildfilename=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.filename') - remotebuildurl=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.urls.cdn') - remotebuildhash=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.md5') + remotebuildfilename=$(echo "${remotebuildresponse}" | jq --arg remotebuild "${remotebuild}" -r '.[$remotebuild].linuxserver.filename') + remotebuildurl=$(echo "${remotebuildresponse}" | jq --arg remotebuild "${remotebuild}" -r '.[$remotebuild].linuxserver.urls.cdn') + remotebuildhash=$(echo "${remotebuildresponse}" | jq --arg remotebuild "${remotebuild}" -r '.[$remotebuild].linuxserver.md5') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -59,7 +62,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -70,35 +73,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -133,26 +136,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh old mode 100644 new mode 100755 index f2cdbe324..904b7b1a4 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -1,11 +1,11 @@ #!/bin/bash -# LinuxGSM command_ut99.sh module +# LinuxGSM command_xnt.sh module # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Handles updating of Unreal Tournament 99 servers. +# Description: Handles updating of Xontic servers. -module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. @@ -17,10 +17,23 @@ fn_update_dl() { fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - + check_status.sh # Send version command to Xonotic server. - tmux -L "${socketname}" send-keys -t "${sessionname}" "version\r" > /dev/null 2>&1 - fn_sleep_time_1 + if [ "${status}" != "0" ]; then + tmux -L "${socketname}" send-keys -t "${sessionname}" "version" C-m > /dev/null 2>&1 + fn_sleep_time_1 + else + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + fn_sleep_time_5 + tmux -L "${socketname}" send-keys -t "${sessionname}" "version" C-m > /dev/null 2>&1 + exitbypass=1 + command_stop.sh + unset exitbypass + fn_firstcommand_reset + fi # Uses log file to get local build. localbuild=$(grep "SVQC version: xonotic-v" "${consolelogdir}"/* 2> /dev/null | tail -1 | sed 's/.*SVQC version: \(xonotic-v[0-9.]*\).*/\1/' | tr -d '\000-\011\013-\037') @@ -36,20 +49,20 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://api.github.com/repos/xonotic/xonotic/tags" remotebuildresponse=$(curl -s "${apiurl}") remotebuildtag=$(echo "${remotebuildresponse}" | jq -r '.[0].name') remotebuildfilename=$(echo "${remotebuildtag}" | tr -d 'v') remotebuildfilename="${remotebuildfilename}.zip" remotebuildurl="https://dl.xonotic.org/${remotebuildfilename}" - - remotebuildversion="${remotebuildtag}" + remotebuild="${remotebuildtag}" + remotebuildhash=$(curl -s "https://dl.xonotic.org/${remotebuildfilename%.zip}.sha512" | grep "${remotebuildfilename}$" | grep -oE '[a-f0-9]{128}') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -59,7 +72,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -70,35 +83,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -133,26 +146,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } diff --git a/linuxgsm.sh b/linuxgsm.sh index 9c35a6b84..f664749e6 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v24.3.2" +version="v26.1.0" shortname="core" gameservername="core" commandname="CORE" @@ -32,7 +32,8 @@ rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") lgsmdir="${rootdir}/lgsm" [ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" -lgsmlogdir="${logdir}/lgsm" +lgsmlogdir="${logdir}/script" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" steamcmddir="${HOME}/.steam/steamcmd" [ -n "${LGSM_SERVERFILES}" ] && serverfiles="${LGSM_SERVERFILES}" || serverfiles="${rootdir}/serverfiles" modulesdir="${lgsmdir}/modules" @@ -70,6 +71,42 @@ core_modules.sh() { # Bootstrap # Fetches the core modules required before passed off to core_dl.sh. +fn_bootstrap_fetch_trap() { + echo -e "" + echo -en "downloading ${local_filename}" + fn_print_canceled_eol_nl + fn_script_log_info "Downloading ${local_filename}...CANCELED" + rm -f "${local_filedir:?}/${local_filename}" + echo -en "downloading ${local_filename}" + fn_print_removed_eol_nl + fn_script_log_info "Downloading ${local_filename}...REMOVED" + core_exit.sh +} + +# Fetches modules from the Git repo during first download. +fn_bootstrap_fetch_module() { + github_file_url_dir="lgsm/modules" + github_file_url_name="${modulefile}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" + else + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${modulesdir}" + local_filename="${github_file_url_name}" + chmodx="chmodx" + run="run" + forcedl="noforce" + hash="nohash" + # Passes vars to the file download module. + fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" +} + fn_bootstrap_fetch_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" @@ -80,7 +117,8 @@ fn_bootstrap_fetch_file() { chmodx="${7:-0}" run="${8:-0}" forcedl="${9:-0}" - md5="${10:-0}" + hash="${10:-0}" + # Download file if missing or download forced. if [ ! -f "${local_filedir}/${local_filename}" ] || [ "${forcedl}" == "forcedl" ]; then # If backup fileurl exists include it. @@ -107,44 +145,54 @@ fn_bootstrap_fetch_file() { mkdir -p "${local_filedir}" fi # Trap will remove part downloaded files if canceled. - trap fn_fetch_trap INT - # Larger files show a progress bar. - - echo -en "fetching ${fileurl_name} ${local_filename}...\c" - curlcmd=$(curl --connect-timeout 3 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) - - local exitcode=$? + trap fn_bootstrap_fetch_trap INT + curlcmd=(curl --connect-timeout 3 --fail -L -o "${local_filedir}/${local_filename}" --retry 2 -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randomint}.212 Safari/537.36") + + # if is large file show progress, else be silent + local exitcode="" + large_files=("bz2" "gz" "zip" "jar" "xz") + if grep -qE "(^|\s)${local_filename##*.}(\s|$)" <<< "${large_files[@]}"; then + echo -e "downloading file [ ${local_filename} ]" + fn_sleep_time + "${curlcmd[@]}" --progress-bar "${fileurl}" 2>&1 + exitcode=$? + echo -en "downloading file [ ${local_filename} ]" + else + echo -en "fetching ${fileurl_name} [ ${local_filename} ]\c" + "${curlcmd[@]}" --silent --show-error "${fileurl}" 2>&1 + exitcode=$? + fi # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then - if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then - rm -f "${local_filedir:?}/${local_filename:?}" + if head -n 1 "${local_filedir}/${local_filename}" | grep -q "DOCTYPE"; then + rm "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi fi # On first try will error. On second try will fail. - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then if [ ${counter} -ge 2 ]; then - echo -e "FAIL" + echo -e " ... FAIL" if [ -f "${lgsmlog}" ]; then - fn_script_log_fail "Downloading ${local_filename}" + fn_script_log_fail "Downloading ${local_filename}..." fn_script_log_fail "${fileurl}" fi core_exit.sh else - echo -e "ERROR" + echo -e " ... ERROR" if [ -f "${lgsmlog}" ]; then - fn_script_log_error "Downloading ${local_filename}" + fn_script_log_error "Downloading ${local_filename}..." fn_script_log_error "${fileurl}" fi fi else - echo -en "OK" - sleep 0.3 - echo -en "\033[2K\\r" + echo -en " ... OK" + sleep "0.1" + echo -e "\033\\r" if [ -f "${lgsmlog}" ]; then - fn_script_log_pass "Downloading ${local_filename}" + fn_script_log_pass "Downloading ${local_filename}..." fi # Make file executable if chmodx is set. @@ -246,7 +294,8 @@ fn_install_menu_whiptail() { menu_options+=("${val//\"/}" "${key//\"/}") done < "${options}" OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) - if [ $? == 0 ]; then + exitcode=$? + if [ "${exitcode}" -eq 0 ]; then eval "$resultvar=\"${OPTION}\"" else eval "$resultvar=" @@ -281,7 +330,8 @@ fn_install_menu() { # Gets server info from serverlist.csv and puts in to array. fn_server_info() { IFS="," - server_info_array=($(grep -aw "${userinput}" "${serverlist}")) + server_info_line="$(grep -aw "${userinput}" "${serverlist}" | head -n 1)" + read -r -a server_info_array <<< "${server_info_line}" shortname="${server_info_array[0]}" # csgo gameservername="${server_info_array[1]}" # csgoserver gamename="${server_info_array[2]}" # Counter Strike: Global Offensive @@ -395,13 +445,14 @@ else fi if [ ! -f "${configdirserver}/_default.cfg" ]; then mkdir -p "${configdirserver}" - echo -en "copying _default.cfg...\c" + echo -en "copying _default.cfg\c" cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" - if [ $? != 0 ]; then - echo -e "FAIL" + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + echo -e " ... FAIL" exit 1 else - echo -e "OK" + echo -e " ... OK" fi else config_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") @@ -409,11 +460,12 @@ else fn_print_warn_nl "_default.cfg has altered. reloading config." echo -en "copying _default.cfg...\c" cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" - if [ $? != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then echo -e "FAIL" exit 1 else - echo -e "OK" + echo -e " ... OK" fi fi fi diff --git a/package-lock.json b/package-lock.json index 076a14533..581f6ea8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,11 +7,11 @@ "name": "linuxgsm", "license": "MIT", "dependencies": { - "gamedig": "^5.0.0-beta.2" + "gamedig": "^5.1.4" }, "devDependencies": { - "prettier": "^3.0.3", - "prettier-plugin-sh": "^0.13.1" + "prettier": "^3.4.2", + "prettier-plugin-sh": "^0.14.0" } }, "node_modules/@sindresorhus/is": { @@ -269,19 +269,18 @@ } }, "node_modules/gamedig": { - "version": "5.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gamedig/-/gamedig-5.0.0-beta.2.tgz", - "integrity": "sha512-YsHoGdb6rXyzdErakd9eSJvUAZCa8Hy+nQpiWZMps158wOovsH35Yrr/Y9wCvn1FDm6NJnHhQYkvtk3zhlmKWQ==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/gamedig/-/gamedig-5.1.4.tgz", + "integrity": "sha512-MgSbNVGh5QMdrmRTrZ3W7W6sC5/Mx+dMgTy2uZCKQ9vns9eFXkQj61Pw2Y2FNHNMMp4DXFSUMYAPJWLcR16Wwg==", "dependencies": { - "cheerio": "^1.0.0-rc.12", - "gbxremote": "^0.2.1", - "got": "^13.0.0", - "iconv-lite": "^0.6.3", - "long": "^5.2.3", - "minimist": "^1.2.8", - "punycode": "^2.3.0", - "seek-bzip": "^2.0.0", - "varint": "^6.0.0" + "cheerio": "1.0.0-rc.12", + "gbxremote": "0.2.1", + "got": "13.0.0", + "iconv-lite": "0.6.3", + "long": "5.2.3", + "minimist": "1.2.8", + "seek-bzip": "2.0.0", + "varint": "6.0.0" }, "bin": { "gamedig": "bin/gamedig.js" @@ -504,9 +503,9 @@ } }, "node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -519,9 +518,9 @@ } }, "node_modules/prettier-plugin-sh": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/prettier-plugin-sh/-/prettier-plugin-sh-0.13.1.tgz", - "integrity": "sha512-ytMcl1qK4s4BOFGvsc9b0+k9dYECal7U29bL/ke08FEUsF/JLN0j6Peo0wUkFDG4y2UHLMhvpyd6Sd3zDXe/eg==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-sh/-/prettier-plugin-sh-0.14.0.tgz", + "integrity": "sha512-hfXulj5+zEl/ulrO5kMuuTPKmXvOg0bnLHY1hKFNN/N+/903iZbNp8NyZBTsgI8dtkSgFfAEIQq0IQTyP1ZVFQ==", "dev": true, "dependencies": { "mvdan-sh": "^0.10.1", @@ -534,7 +533,7 @@ "url": "https://opencollective.com/unts" }, "peerDependencies": { - "prettier": "^3.0.0" + "prettier": "^3.0.3" } }, "node_modules/process-nextick-args": { @@ -542,14 +541,6 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "engines": { - "node": ">=6" - } - }, "node_modules/quick-lru": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", diff --git a/package.json b/package.json index 7fa277dcc..b9a348507 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,27 @@ { - "name": "linuxgsm", - "description": "


\"LinuxGSM\"

", - "directories": { - "test": "tests" - }, - "devDependencies": { - "prettier": "^3.0.3", - "prettier-plugin-sh": "^0.13.1" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GameServerManagers/LinuxGSM.git" - }, - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/GameServerManagers/LinuxGSM/issues" - }, - "homepage": "https://github.com/GameServerManagers/LinuxGSM#readme", - "dependencies": { - "gamedig": "^5.1.3" - } + "name": "linuxgsm", + "description": "


\"LinuxGSM\"

", + "directories": { + "test": "tests" + }, + "devDependencies": { + "prettier": "^3.4.2", + "prettier-plugin-sh": "^0.14.0" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/GameServerManagers/LinuxGSM.git" + }, + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/GameServerManagers/LinuxGSM/issues" + }, + "homepage": "https://github.com/GameServerManagers/LinuxGSM#readme", + "dependencies": { + "gamedig": "^5.1.4" + } }