### Alert Configuration Example Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Example configuration for setting up notification alerts per-instance in `lgsm/config-lgsm/[gameservername]/[instance].cfg` or globally in `common.cfg`. Alerts fire on server events like start, stop, crashes, and updates. ```bash # lgsm/config-lgsm/mcserver/mcserver.cfg ``` -------------------------------- ### Install Game Server Files Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt After the server script is created, run its install command to download and set up the game server files. ```bash ./mcserver install # Expected output: # Installed Minecraft server as mcserver # ./mcserver install ``` -------------------------------- ### Install LinuxGSM Installer Script Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Download the main `linuxgsm.sh` script and make it executable. This script is the entry point for all LinuxGSM operations. ```bash curl -Lo linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh ``` -------------------------------- ### Install a Game Server Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Use the installer script to add a game server. You can choose interactively, specify the game directly, or use the automated option. ```bash ./linuxgsm.sh install ``` ```bash ./linuxgsm.sh csgoserver # Counter-Strike: Global Offensive ./linuxgsm.sh mcserver # Minecraft ./linuxgsm.sh rustserver # Rust ``` ```bash ./linuxgsm.sh auto-install ``` -------------------------------- ### Start a Game Server Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Launches the game server in a detached tmux session. Optionally performs an update first if configured. Triggers a 'started' alert if enabled. ```bash ./mcserver start # Expected output: # [ OK ] Starting Minecraft ``` ```bash # Start with update-on-start enabled (set in config): # updateonstart="on" # in lgsm/config-lgsm/mcserver/mcserver.cfg ./mcserver start # Expected output: # [ INFO ] Updating Minecraft # [ OK ] Updating Minecraft: 1.21 -> 1.21.1 # [ OK ] Starting Minecraft ``` ```bash # Short-form alias ./mcserver st ``` -------------------------------- ### Debug Server Startup Issues Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Run a game server directly in the terminal without tmux for live debugging. This is useful when a server fails to start and you need to see the console output directly. Use CTRL+c to stop. ```bash ./mcserver debug # Runs the server binary directly in the terminal # All output is visible live # Press CTRL+c to stop # Short alias ./mcserver d ``` -------------------------------- ### Restart a Game Server Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Restarts the game server by first stopping it and then starting it. Triggers a 'restarted' alert if enabled. ```bash ./mcserver restart # Expected output: # [ OK ] Stopping Minecraft # [ OK ] Starting Minecraft ``` ```bash # Short-form alias ./mcserver r ``` -------------------------------- ### Update Game Server Files Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Checks the installed build against the remote version and downloads updates if available. Stops the server if running and restarts it after updating. Supports SteamCMD and custom update modules. ```bash ./mcserver update # Expected output: # [ INFO ] Checking for updates: Minecraft # Current version: 1.21 # Latest version: 1.21.1 # [ INFO ] Applying update # [ OK ] Updating Minecraft: 1.21 -> 1.21.1 ``` ```bash # Force update, bypassing version comparison ./mcserver force-update # alias: fu ``` ```bash # Check available updates without applying ./mcserver check-update # alias: cu ``` ```bash # SteamCMD-based server example (CS2) ./cs2server update # Short alias ./cs2server u ``` -------------------------------- ### Mod Management Commands Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Provides interactive menus for installing, removing, and updating mods and addons for compatible game engines. Supported mods include Metamod, SourceMod, Oxide, and uMod. ```bash # Browse and install available mods ./tf2server mods-install # alias: mi ``` ```bash # List installed mods and choose one to remove ./tf2server mods-remove # alias: mr ``` ```bash # Update all installed mods ./tf2server mods-update # alias: mu ``` ```bash # Example install flow: # ┌──────────────────────────────────────────┐ # │ 1) Metamod:Source - Metamod plugin loader│ # │ 2) SourceMod - Server plugin system │ # └──────────────────────────────────────────┘ # Select: 2 # [ OK ] Installing SourceMod ``` -------------------------------- ### LinuxGSM Configuration File Hierarchy Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Understand the order in which LinuxGSM loads configuration files, from lowest to highest priority. Instance-specific secrets override instance configs, which override common configs, which override default configs. This example shows settings for a Minecraft server and how to run multiple instances. ```bash # File load order (lowest to highest priority): # 1. lgsm/config-default/config-lgsm/[game]/_default.cfg (DO NOT EDIT - auto-managed) # 2. lgsm/config-lgsm/[instance]/common.cfg (shared across all instances) # 3. lgsm/config-lgsm/[instance]/secrets-common.cfg (shared secrets) # 4. lgsm/config-lgsm/[instance]/[instance].cfg (this instance's settings) # 5. lgsm/config-lgsm/[instance]/secrets-[instance].cfg (this instance's secrets) # Example: lgsm/config-lgsm/mcserver/mcserver.cfg servername="My Minecraft Server" maxplayers="20" port="25565" queryport="25565" updateonstart="on" consolelogging="on" logdays="14" querydelay="2" # wait 2 min after start before querying sleeptime="0.5" # Example: Run two Minecraft instances simultaneously ./mcserver install # creates mcserver ./mcserver2 install # creates mcserver2 (copy linuxgsm.sh, install again) # Each has its own config dir: lgsm/config-lgsm/mcserver2/ ``` -------------------------------- ### Update LinuxGSM Modules Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Downloads the latest LinuxGSM module files from GitHub, pinned to the installed version tag. Useful after upgrading the main linuxgsm.sh script. ```bash ./mcserver update-lgsm # Expected output: # [ OK ] Updating LinuxGSM modules to v26.1.0 # Short alias ./mcserver ul ``` -------------------------------- ### Validate Server Files via SteamCMD Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Validates all installed game server files against Steam's manifest, repairing corrupted or missing files. This command is only available for SteamCMD-managed servers. ```bash ./cs2server validate # Expected output: # [ INFO ] Validating CS2 server files via SteamCMD # [ OK ] Validation complete — 0 files repaired # Short alias ./cs2server v ``` -------------------------------- ### Override LinuxGSM Directories with Environment Variables Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Set environment variables to change default directories for server files, logs, data, and configuration. This is useful for Docker or multi-tenant setups. You can also specify custom GitHub forks or branches for LinuxGSM. ```bash # Override server files directory (useful in Docker) export LGSM_SERVERFILES="/data/gameserver/serverfiles" # Override log directory export LGSM_LOGDIR="/var/log/lgsm" # Override data directory (stores serverlist.csv, UIDs) export LGSM_DATADIR="/data/lgsm/data" # Override config directory export LGSM_CONFIG="/data/lgsm/config" # Use a fork or custom branch instead of the official repo export LGSM_GITHUBUSER="MyOrg" export LGSM_GITHUBREPO="LinuxGSM-fork" export LGSM_GITHUBBRANCH="custom-branch" # Then run normally ./mcserver start ``` -------------------------------- ### List Supported Game Servers Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt View a list of all game servers supported by LinuxGSM. ```bash ./linuxgsm.sh list ``` -------------------------------- ### Display Server Status and Configuration Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Shows detailed information about the game server, including system resource usage, server name, game version, player count, and configuration parameters. ```bash ./mcserver details # Example output (abridged): # Distro: Ubuntu 22.04.3 LTS # CPU: 8 Core(s) - Intel(R) Core(TM) i7 # RAM: Used: 2.1G/16G # ───────────────────────────── # Server name: My Minecraft Server # Game: Minecraft 1.21.1 # Status: ONLINE # Players: 3/20 # Map: world # ───────────────────────────── # Ports IP Port Status ``` -------------------------------- ### Create Compressed Server Backup Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Creates a timestamped archive of all server files, automatically selecting the fastest available compressor. Prunes old backups based on `maxbackups` and `maxbackupdays` configuration. ```bash ./mcserver backup # Expected output: # [ INFO ] Starting backup: Previous backups found # * Previous backup was created 1 day ago, total size 234M # [ OK ] Backup (1.2G) mcserver-2024-11-15-143022.tar.zst ``` ```bash # Configuration in lgsm/config-lgsm/mcserver/mcserver.cfg: maxbackups="4" # keep last 4 backups maxbackupdays="30" # delete backups older than 30 days stoponbackup="on" # stop server during backup (safest) # Short alias ./mcserver b ``` -------------------------------- ### Contribute to Support Volunteer Source: https://github.com/gameservermanagers/linuxgsm/wiki/Support-Guide This command indicates the path to becoming a support volunteer within the LinuxGSM project. It's a conceptual representation of progression. ```bash support contributor > support volunteer ``` -------------------------------- ### Configure Server Alerts Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Enable and configure various alert types for server status changes. Ensure correct webhook URLs and API tokens are provided. ```bash # Enable status alerts (started/stopped/restarted) statusalert="on" # Discord webhook alert discordalert="on" discordwebhook="https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN" # Telegram alert telegramalert="on" telegramtoken="YOUR_BOT_TOKEN" telegramchatid="YOUR_CHAT_ID" # Email alert (requires sendmail/msmtp) emailalert="on" email="admin@example.com" emailfrom="server@example.com" # Slack alert slackalert="on" slackwebhook="https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK" # ntfy alert ntfyalert="on" ntfytopic="my-server-alerts" ntfyserver="https://ntfy.sh" # Pushover alert pushoveralert="on" pushovertoken="YOUR_APP_TOKEN" pushoveruserkey="YOUR_USER_KEY" ``` -------------------------------- ### Access Live Server Console Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Attaches to the server's tmux session to view live output and type commands. Detach using 'CTRL+b d'. Do not use CTRL+c as it will kill the server. ```bash ./mcserver console # Output: # * Press "CTRL+b" then "d" to exit console. # ! Do NOT press CTRL+c to exit. # Continue? [Y/n] Y # [ OK ] Accessing console # (tmux session attached — you see live Minecraft log output) # > say Hello players! ← type server commands here # CTRL+b then d ← detach safely ``` -------------------------------- ### Configure GitHub Branch for Testing Source: https://github.com/gameservermanagers/linuxgsm/blob/master/CONTRIBUTING.md Modify these variables in `linuxgsm.sh` to test your local code branch. This forces the script to use your specified GitHub user, repository, and branch. ```bash ## GitHub Branch Select # Allows for the use of different function files # from a different repo and/or branch. githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="master" ``` -------------------------------- ### Test Notification Alert Integrations Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Fires a test alert through all configured notification channels (Discord, Telegram, Slack, Email) to verify credentials and webhooks. Alerts are configured per-instance or globally. ```bash ./mcserver test-alert # Expected output: # [ OK ] Sending Discord alert # [ WARN ] Email alerts not enabled # [ WARN ] Telegram Messages not enabled # Short alias ./mcserver ta ``` -------------------------------- ### Monitor Game Server Health Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Checks if the server tmux session is alive and optionally queries the game port. Restarts the server if it's unresponsive or fails to query, and fires a monitor alert. ```bash # Run manually ./mcserver monitor ``` ```bash # Typical cron setup — run every 5 minutes crontab -e # Add: # */5 * * * * /home/gameserver/mcserver monitor > /dev/null 2>&1 ``` ```bash # Expected output when healthy: # [ OK ] Checking session # [ OK ] Querying port: gamedig: 192.168.1.10:25565 : 0/1 # Expected output when crashed (triggers restart): # [ FAIL ] Checking session # [ INFO ] Monitor is restarting mcserver ``` -------------------------------- ### Stop a Game Server Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Gracefully shuts down the game server. Falls back to killing the tmux session if the graceful shutdown times out. Triggers a 'stopped' alert if enabled. ```bash ./mcserver stop # Expected output: # [ OK ] Stopping Minecraft: Graceful: sending "stop": 3 seconds ``` ```bash # Short-form alias ./mcserver sp ``` ```bash # Stop mode is configured per game server in _default.cfg / instance config: # stopmode="5" # 5 = send "stop" command, wait up to 30s # stopmode="2" # 2 = CTRL+c # stopmode="1" # 1 = immediate tmux kill-session ``` -------------------------------- ### Send Command to Server Console Non-Interactively Source: https://context7.com/gameservermanagers/linuxgsm/llms.txt Sends a single console command to the running tmux session without attaching to it. Useful for scripting or cron jobs. Commands can be passed interactively or as a second argument. ```bash ./mcserver send # send: say Server restarting in 5 minutes! ``` ```bash ./mcserver send "say Server restarting in 5 minutes!" ./mcserver send "op myusername" ./mcserver send "difficulty hard" ``` ```bash # Expected output: # [ OK ] Sending command to console: "say Server restarting in 5 minutes!" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.