Files
jiedian/scripts/remove-vless.sh
T
2026-06-28 00:26:18 +08:00

30 lines
960 B
Bash
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.
#!/usr/bin/env bash
# 已有 VPS:停用 Xray/VLESS,仅保留 Hysteria2
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
[[ $EUID -eq 0 ]] || { echo "请使用 root 运行: sudo bash scripts/remove-vless.sh"; exit 1; }
export JIEDIAN_ROOT="$ROOT"
echo "[1/4] 停止并禁用 Xray ..."
systemctl stop xray 2>/dev/null || true
systemctl disable xray 2>/dev/null || true
echo "[2/4] 更新代码并重载 sing-box 配置 ..."
if [[ -d "$ROOT/.git" ]]; then
git -C "$ROOT" pull --ff-only || echo "git pull 跳过,请手动同步)"
fi
python3 "$ROOT/scripts/render-server.py"
echo "[3/4] 重启服务 ..."
systemctl restart sing-box jiedian-panel
echo "[4/4] 可选:关闭防火墙 443(若不再需要) ..."
ufw delete allow 443/tcp 2>/dev/null || true
echo ""
echo "完成。VLESS 已停用,面板仅显示 Hysteria2 链接。"
echo "客户端请删除旧 VLESS 节点,从面板复制 hy2:// 链接导入。"