From 61b126195a62b39aa131025123bca241c279bc34 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sat, 17 Jul 2021 23:52:05 -0500 Subject: [PATCH] Initial commit --- .gitignore | 987 ++++++++++++++++++++++++++++ Create-Remote-User.bash | 39 ++ Install-SteamCMD.bash | 17 + Mordhau/Mordhau-Connect-Server.bash | 12 + Mordhau/Mordhau-Start-Server.bash | 48 ++ 5 files changed, 1103 insertions(+) create mode 100644 .gitignore create mode 100755 Create-Remote-User.bash create mode 100755 Install-SteamCMD.bash create mode 100755 Mordhau/Mordhau-Connect-Server.bash create mode 100755 Mordhau/Mordhau-Start-Server.bash diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3466d21 --- /dev/null +++ b/.gitignore @@ -0,0 +1,987 @@ +#!/usr/bin/env file . + +# -*- Coding: UTF-8 -*- +# -*- System: Linux -*- +# -*- Usage: *.* -*- + +# Owner: Jacob B. Sanders +# License: BSD 2-Clause License +# Website: code.cloud-technology.io + +# +# Copyright 2020, Jacob B. Sanders - Cloud Hybrid LLC. & Affiliates +# +# Redistribution and use in source and binary forms, with or without modification, are permitted +# provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list of +# conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. +# + +# ================================================================================================= +# Local Configuration +# ================================================================================================= + +Nexus.PID + +alembic.ini + +Nexus-API-Log.JSON +Nexus-API-Log.Log +Nexus-API-Log.Yaml + +Nexus-API-Log.Yaml.* + +Asynchronous.Log +Asynchronous.Log.* + +Fast-API.Log +Fast-API.Log.* + +Uvicorn.Log +Uvicorn.Log.* + +Starlette.Log +Starlette.Log.* + +Discord-Bot.Log +Discord-Bot.Log.* + +TTY.Wrapper + +node_modules +node_modules/ +node_modules/* +node_modules/*/** +*/node_modules +**/*/node_modules + +**node_modules** + +*.pem +*.key +*.ca +*.cert + +Artifact/Distribution +Artifact/Distribution/* +Artifact/Distribution/** + +!IDE-Settings.zip + +*Log.* + +!Dependencies + +!API/Discord/Source + +.CI-CD-Project-ID +.CI-CD-UAT-Token +.CI-CD-Default-Branch + +API/Configuration/Token + +Cloud-ASGI-Log.UTF-8 + +Cloud_ASGI.egg-info + +Nexus-API-Log.* +Nexus-API-Log.YAML +Nexus-API-Log.YAML.* + +*.egg_info +*.egg_info/* + +*egg* +**egg* +**egg** + +./API/__version__.py +./API/Version.py +./API/PEM.py + +*.whl + +# +# ================================================================================================= +# Cloud-Technology Universal .gitignore +# ================================================================================================= +# +# The following sections will contain directories, files, & wildcards relating +# to special rules that either force include or prevent file-descriptors +# from being tracked via source [version] control. +# +# Note: Sections may contain duplicates -- which is intentional. Usage can +# simply include the entire file, or copy-and-pasted sections. +# +# General Section Stucture +# ------------------------- +# >>> # [File] +# >>> # [Folder]/ +# >>> # .[Dot-File] +# >>> # .[Dot-Folder]/ +# >>> # *[Wild-Card-File] +# >>> # *[Wild-Card-Folder]/ +# >>> # *.[Wild-Card-Dot-File] +# >>> # *.[Wild-Card-Dot-Folder]/ +# + +# +# ============================================================================ +# Python +# ============================================================================ +# +# References +# ----------- +# PEP: https://github.com/github/gitignore/blob/master/Python.gitignore +# VirtualEnv: https://github.com/github/gitignore/blob/master/Global/VirtualEnv.gitignore +# +# Table of Contents +# ------------------ +# ├── Byte Compilations +# ├── C Extensions +# ├── PyInstaller +# ├── Logging +# ├── PyBuilder +# ├── Unit Testing +# ├── Translations +# ├── Django +# ├── Flask +# ├── Scrapy +# ├── Jupyter +# ├── IPython +# ├── Sphinx +# ├── Packaging +# ├── Celery +# ├── Virtual Environments +# ├── Environments +# ├── Static Typing +# ├── Debug Symbols +# + +# ---------------------------------------------------------------------------- +# Byte Compilations (Python) +# ----------------------------------------------------------------------------- + +__pycache__ + +*.py[cod] +*$py.class + +# ----------------------------------------------------------------------------- +# C Extensions (Python) +# ----------------------------------------------------------------------------- + +*.so + +# ----------------------------------------------------------------------------- +# PyInstaller (Python) +# ----------------------------------------------------------------------------- + +*.manifest +*.spec + +# ----------------------------------------------------------------------------- +# Logging (Python) +# ----------------------------------------------------------------------------- + +pip-log.txt +pip-delete-this-directory.txt + +*.log + +# ------------------------------------------------------------------------------ +# PyBuilder (Python) +# ------------------------------------------------------------------------------ + +target/ + +.pybuilder/ + +# ----------------------------------------------------------------------------- +# Unit Testing (Python) +# ----------------------------------------------------------------------------- + +coverage.xml +nosetests.xml + +site/ +cover/ +htmlcov/ + +.cache +.coverage +.coverage.* +.tox/ +.nox/ +.hypothesis/ +.pytest_cache/ + +*.cover +*.py.cover + +# ----------------------------------------------------------------------------- +# Translations (Python) +# ----------------------------------------------------------------------------- + +*.mo +*.pot + +# ----------------------------------------------------------------------------- +# Django (Python) +# ----------------------------------------------------------------------------- + +db.sqlite3 +db.sqlite3-journal + +local_settings.py + +*.log + +# ----------------------------------------------------------------------------- +# Flask (Python) +# ----------------------------------------------------------------------------- + +instance/ + +.env +.flask +.token +.flask-token +.webassets-cache + +# ----------------------------------------------------------------------------- +# Scrapy (Python) +# ----------------------------------------------------------------------------- + +.scrapy + +# ----------------------------------------------------------------------------- +# Jupyter (Python) +# ----------------------------------------------------------------------------- + +.ipynb_checkpoints + +# ----------------------------------------------------------------------------- +# IPython (Python) +# ----------------------------------------------------------------------------- + +ipython_config.py + +profile_default/ + +# ----------------------------------------------------------------------------- +# Sphinx (Python) +# ----------------------------------------------------------------------------- + +docs/ +_build/ +source/ + +# ----------------------------------------------------------------------------- +# Packaging (Python) +# ----------------------------------------------------------------------------- + +MANIFEST + +MANIFEST.in + +lib +var +dist +eggs +build +Build +lib64 +parts +sdist +wheels +downloads +develop-eggs +pip-wheel-metadata +share/python-wheels + +__pypackages__ +__pycache__ + +.Python +.installed.cfg + +.eggs + +*.egg +*.whl + +*.dist-info + +*.egg-info +*.egg-info/ +*.egg-info/* + +**/*.egg-info +**/*.egg-info/ +**/*.egg-info/* + +**/*/*.egg-info +**/*/*.egg-info/ +**/*/*.egg-info/* + +*.pyc + +!setup.cfg + +Key.PEM + +# ----------------------------------------------------------------------------- +# Celery (Python) +# ----------------------------------------------------------------------------- + +celerybeat-schedule +celerybeat.pid + +# ----------------------------------------------------------------------------- +# Virtual Environments (Python) +# ----------------------------------------------------------------------------- + +.Python + +pyvenv.cfg +Pipfile.lock +pip-selfcheck.json + +.python-version + +.venv/ +.Virtual-Environment/ +.Virtualization/ + +[Bb]in +[Ii]nclude +[Ll]ib +[Ll]ib64 +[Ll]ocal +[Ss]cripts + +# ----------------------------------------------------------------------------- +# Environments (Python) +# ----------------------------------------------------------------------------- + +.env +.venv +Environment.env + +env +venv +ENV +env.bak +venv.bak + +*.lock +*.Lock +*.LOCK + +# ----------------------------------------------------------------------------- +# Static Typing (Python) +# ----------------------------------------------------------------------------- + +.pytype/ + +# ----------------------------------------------------------------------------- +# Debug Symbols (Python) +# ----------------------------------------------------------------------------- + +.cython_debug + +# ----------------------------------------------------------------------------- +# Settings & Build (Python) +# ----------------------------------------------------------------------------- + +setup.cfg + +Static.zip + +# +# ============================================================================ +# C +# ============================================================================ +# Python is a run-time language developed through C-Python (C). Therefore, +# some .gitignore C files may contain python-related contexts. +# +# References +# ----------- +# GitHub: https://github.com/github/gitignore/blob/master/C.gitignore +# +# Table of Contents +# ------------------ +# ├── Prerequisites +# ├── C Extensions (Python) +# ├── Object files +# ├── Linker Output +# ├── Precompiled Headers +# ├── Libraries +# ├── Shared Objects (Windows) +# ├── Executables +# ├── Debug Files +# ├── Kernel Module Compilations +# ├── Core Dumps +# + +# ----------------------------------------------------------------------------- +# Prerequisites (C Programming Language) +# ----------------------------------------------------------------------------- + +*.d + +# ----------------------------------------------------------------------------- +# Object files (C Programming Language) +# ----------------------------------------------------------------------------- + +*.o +*.ko +*.obj +*.elf + +# ----------------------------------------------------------------------------- +# Linker output (C Programming Language) +# ----------------------------------------------------------------------------- + +*.ilk +*.map +*.exp + +# ----------------------------------------------------------------------------- +# Precompiled Headers (C Programming Language) +# ----------------------------------------------------------------------------- + +*.gch +*.pch + +# ----------------------------------------------------------------------------- +# Libraries (C Programming Language) +# ----------------------------------------------------------------------------- + +*.lib +*.a +*.la +*.lo + +# ----------------------------------------------------------------------------- +# Shared objects (inc. Windows DLLs) (C Programming Language) +# ----------------------------------------------------------------------------- + +*.dll +*.so +*.so.* +*.dylib + +# ----------------------------------------------------------------------------- +# Executables (C Programming Language) +# ----------------------------------------------------------------------------- + +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# ----------------------------------------------------------------------------- +# Debug files (C Programming Language) +# ----------------------------------------------------------------------------- + +*.dSYM/ +*.su +*.idb +*.pdb + +# ----------------------------------------------------------------------------- +# Kernel Module Compile Results (C Programming Language) +# ----------------------------------------------------------------------------- + +dkms.conf +modules.order +Module.symvers +Mkfile.old + +.tmp_versions + +*.cmd +*.mod* + +# ----------------------------------------------------------------------------- +# Core Dumps (C Programming Language) +# ----------------------------------------------------------------------------- + +core + +# +# ============================================================================ +# Integrated Development Environments (IDEs) +# ============================================================================ +# +# References +# ----------- +# GitHub: https://github.com/github/gitignore/blob/master/C.gitignore +# +# Table of Contents +# ------------------ +# ├── Visual Studio Code +# ├── X-Code +# │ ├── User settings +# │ ├── Legacy X-Code IDEs +# │ ├── GCC +# ├── Jet-Brains +# │ ├── User +# │ ├── Generated files +# │ ├── Sensitive or high-churn files +# │ ├── Gradle +# │ ├── ( Gradle || Maven ) && Auto-Import +# │ ├── CMake +# │ ├── Mongo Explorer plugin +# │ ├── File Project Format +# │ ├── IntelliJ +# │ ├── Modules +# │ ├── Jira +# │ ├── Android Studio +# │ ├── Editor-based Rest Client +# │ ├── Android Studio 3.1+ Serialized Cache File +# + +# ----------------------------------------------------------------------------- +# Visual Studio Code (IDEs) +# ----------------------------------------------------------------------------- + +.history/ +.vscode/* +*.code-workspace +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# ----------------------------------------------------------------------------- +# X-Code (IDEs) +# ----------------------------------------------------------------------------- + +# --> User settings +xcuserdata + +# --> Legacy X-Code IDEs +build +DerivedData +*.xcscmblueprint +*.xccheckout +*.moved-aside +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +# --> GCC +/*.gcno + +# ----------------------------------------------------------------------------- +# Jet-Brains (IDEA, PyCharm, etc.) (IDEs) +# ----------------------------------------------------------------------------- + +# --> IDE Settings + +**/.idea +**/.idea/ +**/.idea/* + +**/*.idea +**/*.idea/ +**/*.idea/* + +# --> User +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# --> Generated files +.idea/**/contentModel.xml + +# --> Sensitive or high-churn files +.idea/**/dataSources +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# --> Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# --> ( Gradle || Maven ) && Auto-Import +.idea/artifacts +.idea/compiler.xml +.idea/jarRepositories.xml +.idea/modules.xml +.idea/*.iml +.idea/modules +*.iml +*.ipr + +# --> CMake +cmake-build-* + +# --> Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# --> File Project Format +*.iws + +# --> IntelliJ +out + +# --> Modules +.idea_modules + +# --> Jira +atlassian-ide-plugin.xml + +# --> Android Studio +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# --> Editor-based Rest Client +.idea/httpRequests + +# --> Android Studio 3.1+ Serialized Cache File +.idea/caches/build_file_checksums.ser + +# +# ============================================================================ +# MacOS System Files +# ============================================================================ +# +# Table of Contents +# ------------------ +# N/A +# + +.DS_Store +.AppleDouble +.LSOverride + +Icon + +*.hmap + +*.ipa +*.dSYM.zip +*.dSYM + +timeline.xctimeline +playground.xcworkspace + +Carthage/Build + +.accio + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +iOSInjectionProject + +._* + +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +.apdisk +.AppleDB +.AppleDesktop + +Network Trash Folder + +Temporary Items + +# +# ============================================================================ +# Go +# ============================================================================ +# +# Table of Contents +# ------------------ +# ├── Executables +# ├── Libraries +# ├── Coverage & Testing +# ├── Logging +# + +# ----------------------------------------------------------------------------- +# Executables (Go Programming Language) +# ----------------------------------------------------------------------------- + +*.exe +*.exe~ + +# ----------------------------------------------------------------------------- +# Libraries (Go Programming Language) +# ----------------------------------------------------------------------------- + +*.dll +*.dll +*.dylib + +# ----------------------------------------------------------------------------- +# Coverage & Testing (Go Programming Language) +# ----------------------------------------------------------------------------- + +*.test + +# ----------------------------------------------------------------------------- +# Logging (Go Programming Language) +# ----------------------------------------------------------------------------- + +*.out + +# +# ============================================================================ +# Discord API & Bot Development +# ============================================================================ +# +# Table of Contents +# ------------------ +# N/A +# + +Discord-Token +Discord-Token.env +Discord-Token.Environment + +Token +Token.env +Token.Environment + +Discord.Token + +.Discord +.Token +.Discord-Token + +# ----------------------------------------------------------------------------- +# Installers (Discord) +# ----------------------------------------------------------------------------- + +*.deb +*.debian + +# +# ============================================================================ +# Java +# ============================================================================ +# +# References +# ----------- +# GitHub: https://github.com/github/gitignore/blob/master/Java.gitignore +# +# Table of Contents +# ------------------ +# ├── Compilations +# ├── Logging +# ├── BlueJ +# ├── Mobile Tools (J2ME) +# ├── Package Files +# + +# ----------------------------------------------------------------------------- +# Compilations (Java Programming Language) +# ----------------------------------------------------------------------------- + +*.class + +# ----------------------------------------------------------------------------- +# Logging (Java Programming Language) +# ----------------------------------------------------------------------------- + +hs_err_pid* + +*.log + +# ----------------------------------------------------------------------------- +# BlueJ (Java Programming Language) +# ----------------------------------------------------------------------------- + +*.ctxt + +# ----------------------------------------------------------------------------- +# Mobile Tools (J2ME) (Java Programming Language) +# ----------------------------------------------------------------------------- + +.mtj.tmp/ + +# ----------------------------------------------------------------------------- +# Package Files (Java Programming Language) +# ----------------------------------------------------------------------------- + +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# +# ============================================================================ +# Cloud-Technology & Cloud-Hybrid LLC.(s) +# ============================================================================ +# +# Table of Contents +# ------------------ +# ├── Process Management +# ├── File Buffers +# ├── Automation +# + +# ----------------------------------------------------------------------------- +# Process Management (LLC.(s) & Affiliates) +# ----------------------------------------------------------------------------- + +PID.lock +PID.Lock +PID.LOCK + +CID.lock +CID.Lock +CID.LOCK + +Process.lock +Process.Lock +Process.LOCK + +Parent.lock +Parent.Lock +Parent.LOCK + +# ----------------------------------------------------------------------------- +# File Buffers (LLC.(s) & Affiliates) +# ----------------------------------------------------------------------------- + +*~* + +*.socket +*.Socket +*.SOCKET + +# ----------------------------------------------------------------------------- +# Automation (LLC.(s) & Affiliates) +# ----------------------------------------------------------------------------- + +*.unix + +Environment.Properties + +# ----------------------------------------------------------------------------- +# Git (LLC.(s) & Affiliates) +# ----------------------------------------------------------------------------- + +Build/* +Build/** + +*/Build/** + +**/Build/** + +Library/* +Metrics/* +Distribution/* + +# ----------------------------------------------------------------------------- +# Sensitive File(s) & Configuration (LLC.(s) & Affiliates) +# ----------------------------------------------------------------------------- + +TOKEN +Token +token + +.TOKEN +.Token +.token + +*.TOKEN +*.Token +*.token + +.secret +.Secret +.SECRET + +.secrets +.Secrets +.SECRETS + +*.secret +*.Secret +*.SECRET + +*.secrets +*.Secrets +*.SECRETS + +# ----------------------------------------------------------------------------- +# Application (LLC.(s) & Affiliates) +# ----------------------------------------------------------------------------- + +*.egg-info +*.egg-info/ +*.egg-info/* + +**/*.egg-info +**/*.egg-info/ +**/*.egg-info/* + +**/*/*.egg-info +**/*/*.egg-info/ +**/*/*.egg-info/* + +.idea +.idea/ +.idea/* + +*.idea +*.idea/ +*.idea/* + +**/.idea +**/.idea/ +**/.idea/* + +**/*.idea +**/*.idea/ +**/*.idea/* diff --git a/Create-Remote-User.bash b/Create-Remote-User.bash new file mode 100755 index 0000000..a21247f --- /dev/null +++ b/Create-Remote-User.bash @@ -0,0 +1,39 @@ +#!/bin/bash --posix + +set -e + +# Remote System +REMOTE_SSH_SERVER=Kansas-3800X +REMOTE_HOST_NAME=69.30.230.226 +REMOTE_USER_TO_CREATE=Mordhau + +# Local System +SSH_FILE_DIRECTORY=~/.ssh +SSH_FILE_NAME=${REMOTE_USER_TO_CREATE}-id_edcsa +SSH_FILE=${SSH_FILE_DIRECTORY}/${SSH_FILE_NAME} +SSH_HOST=Kansas-3800X + +ssh-keygen -b 521 -t ECDSA -f ${SSH_FILE} -N "" +chmod 600 ${SSH_FILE} + +PUB_KEY_CONTENTS=$(cat ${SSH_FILE}.pub) + +ssh ${REMOTE_SSH_SERVER} -f "useradd ${REMOTE_USER_TO_CREATE}; bash -l" +ssh ${REMOTE_SSH_SERVER} -f "mkdir /home/${REMOTE_USER_TO_CREATE}/.ssh; bash -l" +ssh ${REMOTE_SSH_SERVER} -f "touch /home/${REMOTE_USER_TO_CREATE}/.ssh/authorized_keys; bash -l" +ssh ${REMOTE_SSH_SERVER} -f "echo ${PUB_KEY_CONTENTS} >> /home/${REMOTE_USER_TO_CREATE}/.ssh/authorized_keys; bash -l" +ssh ${REMOTE_SSH_SERVER} -f "chown -R ${REMOTE_USER_TO_CREATE}:${REMOTE_USER_TO_CREATE} /home/${REMOTE_USER_TO_CREATE}/.ssh; bash -l" + +cat << EOF >> ~/.ssh/config +Host ${SSH_HOST} + HostName ${REMOTE_HOST_NAME} + Match user ${REMOTE_USER_TO_CREATE} + Identityfile ${SSH_FILE} + LogLevel INFO +EOF + +ssh ${REMOTE_USER_TO_CREATE}@${SSH_HOST} -f "echo export PATH=$PATH:~/.bin > ~/." +ssh ${REMOTE_USER_TO_CREATE}@${SSH_HOST} -f "echo export PATH=$PATH:~/.bin > ~/.bash_profile" + +echo +echo "Finished, login via ssh with \"${REMOTE_USER_TO_CREATE}@${SSH_HOST}\"" \ No newline at end of file diff --git a/Install-SteamCMD.bash b/Install-SteamCMD.bash new file mode 100755 index 0000000..b8d0b65 --- /dev/null +++ b/Install-SteamCMD.bash @@ -0,0 +1,17 @@ +#!/bin/bash --posix + +set -e + +STEAM_DIRECTORY="${1:-"/home/Steam/"}" + +dnf install -y glibc.i686 libstdc++.i686 tmux +mkdir -p "${STEAM_DIRECTORY}" +cd "${STEAM_DIRECTORY}" +curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - +chmod -R 755 "${STEAM_DIRECTORY}" + +cat << 'EOF' > /usr/sbin/steamcmd +/home/Steam/steamcmd.sh "$@" +EOF + +steamcmd +quit diff --git a/Mordhau/Mordhau-Connect-Server.bash b/Mordhau/Mordhau-Connect-Server.bash new file mode 100755 index 0000000..be6b240 --- /dev/null +++ b/Mordhau/Mordhau-Connect-Server.bash @@ -0,0 +1,12 @@ +#!/usr/bin/bash --posix + +set +e + +[[ "${1}" == "" ]] && echo "Error - Invalid Server ID" \ + && echo " Usage: Mordhau-Connect-Server [Server-ID]" \ + && exit 1 + +tmux attach-session -t "Mordhau-Server-${1}" \ + &>/dev/null || tmux attach-session -t "Mordhau-Server-${1}" + +exit ${?} diff --git a/Mordhau/Mordhau-Start-Server.bash b/Mordhau/Mordhau-Start-Server.bash new file mode 100755 index 0000000..fd450d3 --- /dev/null +++ b/Mordhau/Mordhau-Start-Server.bash @@ -0,0 +1,48 @@ +#!/usr/bin/bash --posix + +# +# Commmand-Line Options: +# -PORT +# -QUERYPORT +# -GAMEINI +# -ENGINEINI +# -BEACONPORT +# -RCONPORT +# -LOG +# -USEALLAVAILABLECORES +# +# Note: When establishing server CLI options, if they are Key-Value +# associated, they cannot be delimited via spaces; instead, +# they must use -KEY=VALUE notation. +# + +set +x + +[[ "${1}" == "" ]] && echo "Error - Invalid Server ID" \ + && echo " Usage: Mordhau-Start-Server [Server-ID] ? [--preserve]" \ + && exit 1 + +[[ "${1}" != "" ]] && set +e + +steamcmd +quit +steamcmd +login anonymous +force_install_dir /home/Mordhau/Server-${1} +app_update 629800 validate +quit + +[[ "${2}" == "--preserve" ]] || rm -r -f "/home/Mordhau/Server-${1}/Mordhau/Content/.modio" + +[[ "$(id -u)" == "0" ]] && tmux new-session -d -s "Mordhau-Server-${1}" \ + /home/Mordhau/Server-${1}/MordhauServer.sh \ + -Port="777${1}" -QueryPort="2700${1}" \ + -BeaconPort="1500${1}" -RCONPort="2600${1}" \ + -LOG -USEALLAVAILABLE + +[[ "$(id -u)" != "0" ]] && tmux new-session -d -s \ + "Mordhau-Server-${1}" \ + /home/Mordhau/Server-${1}/MordhauServer.sh \ + -Port="777${1}" -QueryPort="2700${1}" \ + -BeaconPort="1500${1}" -RCONPort="2600${1}" \ + -LOG -USEALLAVAILABLE + +[[ ${?} == 0 ]] && echo "Successfully Started Server" +[[ ${?} != 0 ]] && echo "Server Return Code: ${?}" + +exit 0