Files
projects-jenz/torchlight_changes_unloze/torchlight3/rotate_warp.sh
T

31 lines
871 B
Bash
Executable File

#!/bin/bash
# rotate_warp.sh — force warp-docker to register fresh and get a new exit IP.
# Called automatically by Commands.py (run_ytdlp_with_rotation) when yt-dlp
# hits YouTube's "Sign in to confirm you're not a bot" check.
#
# Lives at /home/gameservers/css_ze/torchlight3/rotate_warp.sh — same folder
# as _start.sh. Make sure it's executable: chmod +x rotate_warp.sh
set -euo pipefail
WARP_DIR="/home/gameservers/warp-docker"
PROXY="http://127.0.0.1:1080"
cd "$WARP_DIR"
docker compose down
rm -rf ./data/*
docker compose up -d
# Wait for the new WARP registration to actually come online.
for i in $(seq 1 15); do
if curl -s -x "$PROXY" https://cloudflare.com/cdn-cgi/trace 2>/dev/null | grep -q "warp=on"; then
echo "WARP rotated, new IP confirmed"
exit 0
fi
sleep 2
done
echo "WARP did not come back up in time" >&2
exit 1