Overview
TheUpdateServer script handles updating game servers with new files, primarily through Valve’s SteamCMD utility. It automatically stops the server, performs the update, and provides status callbacks.
Basic Usage
TheUpdateServer script is located at ~/_SERVERS/scripts/UpdateServer.
SteamCMD Update
Custom Update Command
Command-Line Parameters
UsernameClient’s GPX username for the server account.
IP AddressServer IP address (e.g.,
192.168.10.10).PortServer port number (e.g.,
27015).Update CommandComplete command-line to execute for the update. Can be a SteamCMD command or custom script.
Server PID FileServer PID filename (if the server maintains its own PID file).
Callback URLURL to notify about update status. Receives
status=updating, status=complete, or status=failed callbacks.Steam Game IDSteam App ID for SteamCMD updates (e.g.,
232330 for Counter-Strike: Source).Steam Login UserSteam username for authentication. Use
anonymous for games that support anonymous downloads.Steam Login PasswordSteam account password (required if not using anonymous login).
Steam Guard CodeSteam Guard authentication code (required if Steam Guard is enabled on the account).
Update Process Flow
Stop Server
Automatically stops the running server by calling:
The server must be stopped before updating to prevent file corruption.
Execute Update
Runs the update command. For SteamCMD updates, sources the
SteamCMDFunctions script and calls steamcmd_update.Monitor Progress
Monitors the update process by checking if the process ID exists. Continues checking every 5 seconds.
SteamCMD Integration
GamePanelX V3 includes comprehensive SteamCMD support through theSteamCMDFunctions script.
SteamCMD Update Function
Thesteamcmd_update() function handles:
-
SteamCMD Installation
- Downloads SteamCMD from Valve’s CDN
- Extracts and sets up the tool
- Handles missing dependencies (like
libstdc++.so.6)
-
Authentication
- Anonymous login support
- Steam account authentication
- Steam Guard code handling
-
Game Installation/Update
- Forces installation directory
- Validates game files with
-validateflag - Uses GNU Screen for console access (if available)
Steam Authentication
Common Steam App IDs
| Game | App ID |
|---|---|
| Counter-Strike: Source | 232330 |
| Counter-Strike: Global Offensive | 740 |
| Team Fortress 2 | 232250 |
| Left 4 Dead 2 | 222860 |
| Garry’s Mod | 4020 |
| Half-Life 2: Deathmatch | 320 |
| ARK: Survival Evolved | 376030 |
| Rust | 258550 |
For a complete list of Steam App IDs, visit the SteamDB Apps page.
Update Process Details
SteamCMD Download and Setup
The update process automatically:-
Downloads SteamCMD:
-
Extracts and prepares:
-
Sets up library paths:
Update Script Generation
A temporary update script is created (.gpxsteamupdate.txt) with commands like:
GNU Screen for Updates
When GNU Screen is available, updates run in a screen session for console access:Process Tracking
The update script tracks processes using:| File | Purpose |
|---|---|
.gpxupdatepid | Main update process PID |
.gpxscreen.pid | GNU Screen session PID (if used) |
.gpxsteam.pid | SteamCMD process PID |
Status Callbacks
When a callback URL is provided with-c, the script sends HTTP requests at key points:
| Status | When Triggered |
|---|---|
updating | Update process has started |
complete | Update finished successfully |
failed | Update failed (no PID, process died unexpectedly) |
Logging
Update operations are logged to multiple locations:- Server Log:
~/logs/servers.log- Main operations and status - Steam Log:
~/logs/steam.log- SteamCMD-specific operations - Update Log:
~/tmp/steam_{template_id}.log- Detailed SteamCMD output
Log Entry Examples
Examples
Error Handling
SteamCMD-Specific Errors
The script detects and handles:-
Missing
GLIBCXX_3.4.10:- Automatically downloads
libstdc++.so.6from GamePanelX CDN - Sets
LD_LIBRARY_PATHappropriately
- Automatically downloads
-
Steam Guard Required:
-
Invalid Password:
Manual Server Restart
The UpdateServer script does not automatically restart the server after updating. You must manually restart it:
Best Practices
- Always Use Callbacks: Implement callback URLs to track update progress
- Test Authentication: Verify Steam credentials before running updates
- Monitor Logs: Check
~/logs/servers.logand~/logs/steam.logfor issues - Disk Space: Ensure adequate free space before starting large updates
- Off-Peak Updates: Schedule updates during low-traffic periods
- Backup First: Consider backing up server files before major updates
- Anonymous When Possible: Use anonymous login for games that support it
Related Scripts
- Creating Servers - Initial server deployment
- Starting & Stopping Servers - Restarting after updates
- Working with Templates - Creating templates from updated servers