This commit is contained in:
Nathan Rashleigh
2026-02-10 10:46:45 +11:00
parent 31a2ac82d0
commit bcf798a5f9
7 changed files with 99 additions and 11 deletions
+1
View File
@@ -0,0 +1 @@
surf_boreas
+51
View File
@@ -451,6 +451,55 @@ EOF
cfg() {
cd
cp etc/cfg/server.cfg cssds/cstrike/cfg/
cp etc/cfg/mapcycle.txt cssds/cstrike/cfg/
sed -i "s|sv_downloadurl .*|sv_downloadurl \"${FASTDL_URL:-}/cstrike/\"|" "$CSTRIKE/cfg/server.cfg"
}
populate_maps() {
local BZ2_DIR="/fastdl/maps"
local MAPS_DIR="$CSTRIKE/maps"
local MAPCYCLE="$CSTRIKE/cfg/mapcycle.txt"
echo "--------------------------------------------------------------"
echo "Populating maps from compressed archive"
echo "--------------------------------------------------------------"
if [ ! -f "$MAPCYCLE" ]; then
echo "No mapcycle.txt found, skipping map population"
echo "--------------------------------------------------------------"
return
fi
mkdir -p "$MAPS_DIR"
local total=0 skipped=0 extracted=0 missing=0
while IFS= read -r line || [ -n "$line" ]; do
# skip empty lines and comments
line=$(echo "$line" | sed 's|//.*||' | xargs)
[ -z "$line" ] && continue
total=$((total + 1))
local bz2="$BZ2_DIR/${line}.bsp.bz2"
local bsp="$MAPS_DIR/${line}.bsp"
if [ -f "$bsp" ]; then
skipped=$((skipped + 1))
continue
fi
if [ ! -f "$bz2" ]; then
missing=$((missing + 1))
echo " [!] ${line}: not in fastdl volume"
continue
fi
bunzip2 -c "$bz2" > "$bsp"
extracted=$((extracted + 1))
done < "$MAPCYCLE"
echo "Maps: $total in mapcycle, $extracted extracted, $skipped already present, $missing not available"
echo "--------------------------------------------------------------"
}
@@ -482,6 +531,8 @@ main() {
# Zones will be available after server starts and creates tables
import_zone_data
populate_maps
run_cssds
}