Files
dock/xuiip6
2026-01-14 23:23:47 +08:00

33 lines
878 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
bash << 'EOF'
set -e
echo "=== [1/5] 安装依赖 ==="
apt update -y >/dev/null 2>&1 || true
apt install -y jq >/dev/null 2>&1 || true
XRAY_CONF="/usr/local/x-ui/bin/config.json"
echo "=== [2/5] 备份 Xray 配置 ==="
cp "$XRAY_CONF" "${XRAY_CONF}.bak.$(date +%s)"
echo "=== [3/5] 强制 SOCKS5 出站为 IPv6 + 禁止复用 ==="
jq '
(.outbounds[] | select(.protocol=="freedom")) |=
(.settings.domainStrategy="UseIPv6"
| .settings.redirect=null
| .mux.enabled=false)
|
(.inbounds[] | select(.protocol=="socks")) |=
(.sniffing.enabled=false)
' "$XRAY_CONF" > /tmp/xray.json && mv /tmp/xray.json "$XRAY_CONF"
echo "=== [4/5] 清空所有现有 TCP 会话(防假活)==="
ss -K dst :32238 || true
echo "=== [5/5] 重启服务 ==="
systemctl restart x-ui || true
systemctl restart xray || true
echo "=== 完成SOCKS5 已进入“非假活”模式 ==="
EOF