##!/bin/bash # ============================================================================== # WARP + X-UI & Chisel Tunnel Start Script # ============================================================================== # --- WARP SOCKS5 Proxy Setup --- run_warp() { echo "Setting up WARP..." # Check if an account file already exists if [ ! -f "/config/wgcf-account.toml" ]; then echo "WARP account not found. Registering a new one..." wgcf register --accept-tos --config /config/wgcf-account.toml else echo "Using existing WARP account." fi echo "Generating WireProxy config..." # Generate WireGuard profile from account wgcf generate --config /config/wgcf-account.toml --profile /config/wgcf-profile.conf # Extract info from the WireGuard profile to create wireproxy.conf PRIVATE_KEY=$(grep "PrivateKey" /config/wgcf-profile.conf | cut -d' ' -f3) PUBLIC_KEY=$(grep "PublicKey" /config/wgcf-profile.conf | cut -d' ' -f3) ENDPOINT=$(grep "Endpoint" /config/wgcf-profile.conf | cut -d' ' -f3) # Create wireproxy.conf cat > /config/wireproxy.conf <