From d1dd506b9c2144167179284284ff3a9814aa4bbd Mon Sep 17 00:00:00 2001 From: SamNet-dev Date: Fri, 6 Feb 2026 17:12:48 -0600 Subject: [PATCH] fix: skip xray setup if already running to preserve existing panels --- paqctl.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/paqctl.sh b/paqctl.sh index 88bb143..cda574e 100644 --- a/paqctl.sh +++ b/paqctl.sh @@ -1460,6 +1460,12 @@ setup_xray_for_gfk() { local target_port target_port=$(echo "${GFK_PORT_MAPPINGS:-14000:443}" | cut -d: -f2 | cut -d, -f1) + # If xray is already running (e.g. user has a panel), don't touch it + if pgrep -x xray &>/dev/null; then + log_info "Xray is already running — skipping install/config to preserve existing setup" + return 0 + fi + install_xray || return 1 configure_xray_socks "$target_port" || return 1 start_xray || return 1 @@ -5715,6 +5721,10 @@ start_xray() { setup_xray_for_gfk() { local target_port target_port=$(echo "${GFK_PORT_MAPPINGS:-14000:443}" | cut -d: -f2 | cut -d, -f1) + if pgrep -x xray &>/dev/null; then + log_info "Xray is already running — skipping install/config to preserve existing setup" + return 0 + fi install_xray || return 1 configure_xray_socks "$target_port" || return 1 start_xray || return 1