Skip to main content

Overview

The UpdateServer 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

The UpdateServer script is located at ~/_SERVERS/scripts/UpdateServer.

SteamCMD Update

./UpdateServer -u user123 -i 192.168.10.10 -p 27015 \
  -g 232330 \
  -d anonymous \
  -o './steam -command update ...'

Custom Update Command

./UpdateServer -u user123 -i 192.168.10.10 -p 27015 \
  -o './custom_update_script.sh'

Command-Line Parameters

-u
string
required
UsernameClient’s GPX username for the server account.
-i
string
required
IP AddressServer IP address (e.g., 192.168.10.10).
-p
string
required
PortServer port number (e.g., 27015).
-o
string
required
Update CommandComplete command-line to execute for the update. Can be a SteamCMD command or custom script.
-P
string
Server PID FileServer PID filename (if the server maintains its own PID file).
-c
string
Callback URLURL to notify about update status. Receives status=updating, status=complete, or status=failed callbacks.
-g
string
Steam Game IDSteam App ID for SteamCMD updates (e.g., 232330 for Counter-Strike: Source).
-d
string
Steam Login UserSteam username for authentication. Use anonymous for games that support anonymous downloads.
-e
string
Steam Login PasswordSteam account password (required if not using anonymous login).
-f
string
Steam Guard CodeSteam Guard authentication code (required if Steam Guard is enabled on the account).

Update Process Flow

1

Validation

Validates that all required parameters (-u, -i, -p, -o) are provided.
2

Stop Server

Automatically stops the running server by calling:
~/scripts/Stop -u {username} -i {ip} -p {port}
The server must be stopped before updating to prevent file corruption.
3

Update Callback

If a callback URL is provided, sends a status update:
{callback_url}&do=createsrv_status&status=updating
4

Change Directory

Changes to the server directory:
cd ~/users/{username}/{ip}.{port}
5

Execute Update

Runs the update command. For SteamCMD updates, sources the SteamCMDFunctions script and calls steamcmd_update.
6

Monitor Progress

Monitors the update process by checking if the process ID exists. Continues checking every 5 seconds.
7

Completion Callback

When the update completes successfully:
{callback_url}&do=createsrv_status&status=complete
Or on failure:
{callback_url}&do=createsrv_status&status=failed

SteamCMD Integration

GamePanelX V3 includes comprehensive SteamCMD support through the SteamCMDFunctions script.

SteamCMD Update Function

The steamcmd_update() function handles:
  1. SteamCMD Installation
    • Downloads SteamCMD from Valve’s CDN
    • Extracts and sets up the tool
    • Handles missing dependencies (like libstdc++.so.6)
  2. Authentication
    • Anonymous login support
    • Steam account authentication
    • Steam Guard code handling
  3. Game Installation/Update
    • Forces installation directory
    • Validates game files with -validate flag
    • Uses GNU Screen for console access (if available)

Steam Authentication

# Most Source games support anonymous downloads
./UpdateServer -u user123 -i 192.168.10.10 -p 27015 \
  -g 232330 \
  -d anonymous \
  -o './steam -command update ...'

Common Steam App IDs

GameApp ID
Counter-Strike: Source232330
Counter-Strike: Global Offensive740
Team Fortress 2232250
Left 4 Dead 2222860
Garry’s Mod4020
Half-Life 2: Deathmatch320
ARK: Survival Evolved376030
Rust258550
For a complete list of Steam App IDs, visit the SteamDB Apps page.

Update Process Details

SteamCMD Download and Setup

The update process automatically:
  1. Downloads SteamCMD:
    wget -q "http://media.steampowered.com/client/steamcmd_linux.tar.gz"
    
  2. Extracts and prepares:
    tar -zxf steamcmd_linux.tar.gz
    chmod u+x ./steamcmd.sh
    
  3. Sets up library paths:
    export LD_LIBRARY_PATH=linux32/
    

Update Script Generation

A temporary update script is created (.gpxsteamupdate.txt) with commands like:
login anonymous
force_install_dir /full/path/to/server/{game_id}
app_update {game_id} -validate
quit
Or for authenticated logins:
login {username} {password}
force_install_dir /full/path/to/server/{game_id}
app_update {game_id}
quit

GNU Screen for Updates

When GNU Screen is available, updates run in a screen session for console access:
screen -d -m -S "{ip}.{port}" ./.gpxsteam.sh
To view update progress:
screen -r {ip}.{port}

Process Tracking

The update script tracks processes using:
FilePurpose
.gpxupdatepidMain update process PID
.gpxscreen.pidGNU Screen session PID (if used)
.gpxsteam.pidSteamCMD process PID

Status Callbacks

When a callback URL is provided with -c, the script sends HTTP requests at key points:
StatusWhen Triggered
updatingUpdate process has started
completeUpdate finished successfully
failedUpdate failed (no PID, process died unexpectedly)
Callback format:
{callback_url}&do=createsrv_status&status={updating|complete|failed}

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

2026-03-05 10:15:23 hostname Update: Updating server 192.168.10.10.27015 for user user123, in dir ~/users/user123/192.168.10.10.27015 ...
2026-03-05 10:15:24 hostname Update: Starting on IP: 192.168.10.10, port: 27015, Screen PID: 12345, PID: 12346
2026-03-05 10:25:45 hostname Update: Success: Update completed.
2026-03-05 10:25:45 hostname Update: Server update completed on 192.168.10.10.27015 for user user123.

Examples

# Update Counter-Strike: Source (anonymous)
./UpdateServer \
  -u player1 \
  -i 192.168.1.100 \
  -p 27015 \
  -g 232330 \
  -d anonymous \
  -c "https://panel.example.com/callback.php?id=123" \
  -o './steamcmd.sh +runscript update.txt'

Error Handling

Common Issues:
  • Missing libraries: SteamCMD requires 32-bit libraries on 64-bit systems
  • Steam Guard: Must provide valid code with -f if Steam Guard is enabled
  • Invalid credentials: Check username/password for authenticated downloads
  • No PID: Update process failed to start - check command syntax
  • Disk space: Ensure sufficient space for game files

SteamCMD-Specific Errors

The script detects and handles:
  1. Missing GLIBCXX_3.4.10:
    • Automatically downloads libstdc++.so.6 from GamePanelX CDN
    • Sets LD_LIBRARY_PATH appropriately
  2. Steam Guard Required:
    SteamCMDInstall: This Steam account has Steam Guard active. 
    Enter the Steam Guard code on the Settings page and try again.
    
  3. Invalid Password:
    SteamCMDInstall: Bad password for this Steam account. 
    Please check the Steam password in Settings and try again.
    

Manual Server Restart

The UpdateServer script does not automatically restart the server after updating. You must manually restart it:
~/scripts/Restart -u user123 -i 192.168.10.10 -p 27015 -o '{command}'
See Starting, Stopping, Restarting Servers for restart options.

Best Practices

  1. Always Use Callbacks: Implement callback URLs to track update progress
  2. Test Authentication: Verify Steam credentials before running updates
  3. Monitor Logs: Check ~/logs/servers.log and ~/logs/steam.log for issues
  4. Disk Space: Ensure adequate free space before starting large updates
  5. Off-Peak Updates: Schedule updates during low-traffic periods
  6. Backup First: Consider backing up server files before major updates
  7. Anonymous When Possible: Use anonymous login for games that support it

Build docs developers (and LLMs) love