Update start.sh
Browse files11 unmodified lines121314151617181 unmodified line202122232425262728293031323334353637383940414243444546474849505152535455565758596011 unmodified linescd /app/serverfi# Clean up old jars and setup logsrm -f plugins/Via*.jarrm -f plugins/EaglerX*.jarmkdir -p logs1 unmodified lineecho "[System] Clearing Paperclip cache..."rm -rf cache# Install the official HTTP Proxy module exactly where we are running the serverecho "[System] Installing WebSocket Proxy Dependencies..."npm install http-proxy# 2. Self-Healing PaperMC Downloadif [ -f "server.jar" ]; thenif ! jar tf server.jar >/dev/null 2>&1; thenecho "[System] server.jar is corrupted! Deleting for a fresh download..."rm -f server.jarfifiif [ ! -f "server.jar" ]; thenecho "[System] Downloading Paper 1.12.2..."wget -q -O server.jar https://api.papermc.io/v2/projects/paper/versions/1.12.2/builds/1620/downloads/paper-1.12.2-1620.jarfimkdir -p plugins/EaglercraftXServer# 3. Direct Download Eaglercraft (Bypasses GitHub Scraper Rate Limits)echo "[System] Fetching EaglerXServer & EaglerXRewind..."wget -q -O plugins/EaglerXServer.jar "https://github.com/lax1dude/eaglerxserver/releases/download/v1.0.8/EaglerXServer-1.0.8.jar"wget -q -O plugins/EaglerXRewind.jar "https://github.com/lax1dude/eaglerxserver/releases/download/v1.0.8/EaglerXRewind-1.0.8.jar"# 4. Download ViaVersion Suite from Paper Hangar CDN (Bypasses Jenkins Cloudflare)echo "[System] Fetching ViaVersion Suite from Hangar CDN..."wget -q -O plugins/ViaVersion.jar "https://hangar.papermc.io/api/v1/projects/ViaVersion/versions/latest/PAPER/download"wget -q -O plugins/ViaBackwards.jar "https://hangar.papermc.io/api/v1/projects/ViaBackwards/versions/latest/PAPER/download"wget -q -O plugins/ViaRewind.jar "https://hangar.papermc.io/api/v1/projects/ViaRewind/versions/latest/PAPER/download"# 4.5. Anti-Corruption Check!# If any of the downloaded files are HTML Captcha pages instead of valid Jars, delete them!for jar in plugins/*.jar; doif ! jar tf "$jar" >/dev/null 2>&1; thenecho "[ERROR] $jar is corrupted (Cloudflare Block). Deleting so the server doesn't crash!"rm -f "$jar"fidone11 unmodified lines121314151617181 unmodified line202122232425262728293031323334353637383940414243444546474849505152535455565758596011 unmodified linescd /app/serverfi# Clean up old jars to ensure fresh downloadsrm -f plugins/Via*.jarrm -f plugins/EaglerX*.jarmkdir -p logs1 unmodified lineecho "[System] Clearing Paperclip cache..."rm -rf cache# Install the official HTTP Proxy moduleecho "[System] Installing WebSocket Proxy Dependencies..."npm install http-proxy# We will spoof Google Chrome so Cloudflare/GitHub doesn't block the direct links!CHROME="Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0 Safari/537.36"# 2. Self-Healing PaperMC Downloadif [ -f "server.jar" ] && ! jar tf server.jar >/dev/null 2>&1; thenecho "[System] server.jar is corrupted! Deleting..."rm -f server.jarfiif [ ! -f "server.jar" ]; thenecho "[System] Downloading Paper 1.12.2..."wget -q -U "$CHROME" -O server.jar "https://api.papermc.io/v2/projects/paper/versions/1.12.2/builds/1620/downloads/paper-1.12.2-1620.jar"fimkdir -p plugins/EaglercraftXServer# 3. Direct Links for Eaglercraft (GitHub Releases)echo "[System] Fetching EaglerXServer & EaglerXRewind..."wget -q -U "$CHROME" -O plugins/EaglerXServer.jar "https://github.com/lax1dude/eaglerxserver/releases/download/v1.0.8/EaglerXServer-1.0.8.jar"wget -q -U "$CHROME" -O plugins/EaglerXRewind.jar "https://github.com/lax1dude/eaglerxserver/releases/download/v1.0.8/EaglerXRewind-1.0.8.jar"# 4. Direct Links for ViaVersion Suite (Official PaperMC Hangar CDN)echo "[System] Fetching ViaVersion Suite from Hangar CDN..."wget -q -U "$CHROME" -O plugins/ViaVersion.jar "https://hangar.papermc.io/api/v1/projects/ViaVersion/versions/latest/PAPER/download"wget -q -U "$CHROME" -O plugins/ViaBackwards.jar "https://hangar.papermc.io/api/v1/projects/ViaBackwards/versions/latest/PAPER/download"wget -q -U "$CHROME" -O plugins/ViaRewind.jar "https://hangar.papermc.io/api/v1/projects/ViaRewind/versions/latest/PAPER/download"# 4.5 Anti-Corruption check (Deletes the file if it's an HTML block instead of a Jar)for jar in plugins/*.jar; doif ! jar tf "$jar" >/dev/null 2>&1; thenecho "[ERROR] $jar was blocked by Cloudflare! Deleting..."rm -f "$jar"fidone
start.sh+18-18