Managing a KZ server is not hard when you use scripts to automate things. New maps are released constantly, and we all want to keep the server up to date as soon as possible so players can grind the fresh releases. This guide will help you set up an automated system that checks the Global API every morning, parses new approved maps, adds them to your RockTheVote and Admin Menu, and restarts the server automatically – only when there is a new update.
Requirements
To make this work, your server should be running some standard plugins. I’m assuming you have:
LinuxGSM (cs2server) managing your server
CS2-SimpleAdmin (by daffyyyy) for your admin menu
CounterStrikeSharp as the backbone
CS2KZ Metamod (the plugin by zer0.k)
RockTheVote plugin
jq installed on your Linux machine (it’s a tiny tool to read JSON data)
If you aren’t sure, just run:
sudo apt-get install jq -y
Step 1 – Correct User
First, let’s make sure we are doing everything as the correct user (usually local cs2server user without root permissions) so we don’t mess up permissions.
sudo su - cs2server
Step 2 – Create Scripts Folder
Tidy, little folder to keep the scripts together:
mkdir -p ~/scripts
Step 3 – Admin Sync Script
This first script is a helper. When we get new maps published at cs2kz.org, we want them to appear in our Admin Menu automatically so we can swap to them easily. This script does exactly that, while being smart enough to keep any of our special custom maps safe.
By that, I mean that we can manually add maps to the Admin Menu and the script will keep them intact while updating the Admin Menu json config with the RockTheVote list available for normal users. So all custom maps available to Admins (possibly not WR enabled) are still within the Admin config, but not in the RockTheVote list.
nano ~/scripts/sync_maps.sh
Paste the code:
#!/bin/bash
# CS2 Admin Sync by SpawnTerror 2026
# Paths to your config files
RTV_FILE="/home/cs2server/serverfiles/game/csgo/addons/counterstrikesharp/plugins/RockTheVote/maplist.txt"
ADMIN_FILE="/home/cs2server/serverfiles/game/csgo/addons/counterstrikesharp/configs/plugins/CS2-SimpleAdmin/CS2-SimpleAdmin.json"
# Logic: Merge new maps into Admin Config safely
RTV_JSON=$(grep -vE "^\s*//|^\s*$" "$RTV_FILE" | jq -R -n 'reduce inputs as $line ({}; ($line|split(":")) as $p | .[$p[0] | gsub("^\\s+|\\s+$";"")] = ($p[1] | gsub("^\\s+|\\s+$";"") | tonumber))')
jq --argjson newmaps "$RTV_JSON" '.WorkshopMaps = ($newmaps + .WorkshopMaps)' <(sed 's|//.*||g' "$ADMIN_FILE") > "${ADMIN_FILE}.tmp" && mv "${ADMIN_FILE}.tmp" "$ADMIN_FILE"
Save and Exit (Ctrl+O, hit Enter, then Ctrl+X).
Step 4 – Master Updater Script
This is the brain of the operation. Every morning, it asks the API “Hey, anything new?”. If yes, it grabs the maps, updates your files, and restarts the server. If no, it does nothing 😉
nano ~/scripts/update_rtv.sh
Paste the code:
#!/bin/bash
# CS2 RockTheVote Sync by SpawnTerror 2026
# --- Configuration ---
API_URL="https://api.cs2kz.org/maps?state=approved"
RTV_FILE="/home/cs2server/serverfiles/game/csgo/addons/counterstrikesharp/plugins/RockTheVote/maplist.txt"
SYNC_SCRIPT="/home/cs2server/scripts/sync_maps.sh"
LOG_FILE="/home/cs2server/scripts/map_updates.log"
SERVER_CMD="/home/cs2server/cs2server"
HEADER="//Put your map list here, just official maps for WR"
# --- Temp Files ---
TEMP_NEW="/tmp/kz_new.tmp"
TEMP_OLD="/tmp/kz_old.tmp"
# --- 1. Fetch API Data ---
# Downloads the list and formats it as "mapname:workshopid"
curl -s "$API_URL" | jq -r '.values[] | "\(.name):\(.workshop_id)"' > "$TEMP_NEW"
# Stop if API fails (file is empty)
if [ ! -s "$TEMP_NEW" ]; then exit 1; fi
# --- 2. Compare with Current List ---
grep -vE "^\s*//|^\s*$" "$RTV_FILE" > "$TEMP_OLD" 2> /dev/null || touch "$TEMP_OLD"
NEW_MAPS=$(grep -Fxv -f "$TEMP_OLD" "$TEMP_NEW")
# --- 3. Update if New Maps Found ---
if [ -n "$NEW_MAPS" ]; then
# A. Log changes
echo "========================================" >> "$LOG_FILE"
echo "Update: $(date)" >> "$LOG_FILE"
echo "New maps detected: $NEW_MAPS" >> "$LOG_FILE"
# B. Overwrite Maplist
echo "$HEADER" > "$RTV_FILE"
cat "$TEMP_NEW" >> "$RTV_FILE"
# C. Sync Admin Menu
if [ -f "$SYNC_SCRIPT" ]; then bash "$SYNC_SCRIPT"; fi
# D. Restart Server to Load Maps
echo "Restarting server to apply changes..." >> "$LOG_FILE"
$SERVER_CMD restart >> "$LOG_FILE"
else
echo "No new maps found. No restart needed."
fi
# Cleanup
rm "$TEMP_NEW" "$TEMP_OLD"
Save and Exit (Ctrl+O, hit Enter, then Ctrl+X).
Step 5 – Make The Files Executable
Let’s tell Linux that these are programs that it is allowed to run (execute).
chmod +x ~/scripts/*.sh
Step 6 – Crontab Time
We need to schedule the actions. Open crontab:
crontab -e
I assume you already have ./cs2server monitor command there, so scroll to the bottom of the file and add this line:
30 4 * * * /home/cs2server/scripts/update_rtv.sh >> /home/cs2server/scripts/update.log 2>&1
Save and Exit.
Step 7 – All Done!
Your server is on auto-pilot now. If you have configured the LinuxGSM right, your server will auto update, auto restart and now, it will auto update all the maps as soon as they are approved.
To check the status of the map updates:
cat ~/scripts/map_updates.log
Happy jumping!