Files
metin2-client/tools/server/sbtest/rollback.sh
T
shenleiandClaude Opus 5.5 657e49e52a Switchbot: sbtest isolated test cluster scripts + live test results
tools/server/sbtest/{setup,restart,rollback}.sh build and manage the isolated
203 test cluster (db :15040, auth :11040, channel5 on *_sb schemas with the
unlocked AVA2 protos). Docs record the channel5/sbtest switchbot results:
weapon, ring, talisman, relog (cache + MySQL), same-core warp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:03:07 +09:00

24 lines
867 B
Bash

#!/bin/sh
# Stops the sbtest cluster and puts channel5 back on the live db with the binary it had before setup.sh
# (README.md). The *_sb schemas and /usr/metin2/server/sbtest stay; setup.sh rebuilds them.
set -eu
R=/usr/metin2/server
T=$R/sbtest
C5=$R/channel5/first
[ -f $C5/CONFIG.livedb ] || { echo "no $C5/CONFIG.livedb; channel5 was never moved" >&2; exit 1; }
for d in $C5 $T/auth $T/db; do
[ -f $d/pid ] || continue
p=$(cat $d/pid)
kill -0 "$p" 2>/dev/null || continue
kill -1 "$p"
i=0; while kill -0 "$p" 2>/dev/null && [ $i -lt 40 ]; do sleep 1; i=$((i+1)); done
echo "$d stopped after ${i}s"
done
cp $C5/CONFIG.livedb $C5/CONFIG
[ -e $C5/game.livedb ] && { rm -f $C5/game; mv $C5/game.livedb $C5/game; }
daemon -f sh -c "cd $C5 && exec ./game > stdout 2>&1"; sleep 12
grep -E '^DB_PORT' $C5/CONFIG; ls -l $C5/game
sockstat -l | grep -E ':(13040) '