From 89825de81286d488b605af570748d58cd7b83850 Mon Sep 17 00:00:00 2001 From: kobaltgit Date: Sun, 5 Apr 2026 23:10:37 +0300 Subject: [PATCH] =?UTF-8?q?find=5Fsmart=5Fport()=20{=20=20=20=20=20local?= =?UTF-8?q?=20port=3D443=20=20=20=20=20if=20ss=20-tlnp=20|=20grep=20-qE=20?= =?UTF-8?q?":${port}\b";=20then=20=20=20=20=20=20=20=20=20echo=20-e=20"=20?= =?UTF-8?q?=20${YELLOW}=E2=84=B9=20=D0=9F=D0=BE=D1=80=D1=82=20443=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=BD=D1=8F=D1=82=20(Hiddify/Nginx).=20=D0=9F=D1=80?= =?UTF-8?q?=D0=BE=D0=B1=D1=83=D1=8E=208443...${NC}"=20>&2=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20port=3D8443=20=20=20=20=20=20=20=20=20if=20ss=20-tl?= =?UTF-8?q?np=20|=20grep=20-qE=20":${port}\b";=20then=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20port=3D$((=20(RANDOM=20%=2010000)=20+=2020000?= =?UTF-8?q?=20))=20=20=20=20=20=20=20=20=20=20=20=20=20echo=20-e=20"=20=20?= =?UTF-8?q?${YELLOW}=E2=84=B9=20=D0=9F=D0=BE=D1=80=D1=82=208443=20=D1=82?= =?UTF-8?q?=D0=BE=D0=B6=D0=B5=20=D0=B7=D0=B0=D0=BD=D1=8F=D1=82.=20=D0=92?= =?UTF-8?q?=D1=8B=D0=B1=D1=80=D0=B0=D0=BD=20=D1=81=D0=BB=D1=83=D1=87=D0=B0?= =?UTF-8?q?=D0=B9=D0=BD=D1=8B=D0=B9:=20$port${NC}"=20>&2=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20fi=20=20=20=20=20fi=20=20=20=20=20echo=20"$port"=20}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 8818dfb..cb7eb4e 100644 --- a/install.sh +++ b/install.sh @@ -135,13 +135,12 @@ analyze_best_domain() { # ── Умный поиск порта ──────────────────────────────────────────────────────── find_smart_port() { local port=443 - # Проверяем 443, если занят — проверяем 8443, если и он занят — берем рандом if ss -tlnp | grep -qE ":${port}\b"; then - echo -e " ${YELLOW}ℹ Порт 443 занят (Hiddify/Nginx). Пробую 8443...${NC}" + echo -e " ${YELLOW}ℹ Порт 443 занят (Hiddify/Nginx). Пробую 8443...${NC}" >&2 port=8443 if ss -tlnp | grep -qE ":${port}\b"; then port=$(( (RANDOM % 10000) + 20000 )) - echo -e " ${YELLOW}ℹ Порт 8443 тоже занят. Выбран случайный: $port${NC}" + echo -e " ${YELLOW}ℹ Порт 8443 тоже занят. Выбран случайный: $port${NC}" >&2 fi fi echo "$port" @@ -184,9 +183,10 @@ menu_install() { optimize_system - local DOMAIN=$(analyze_best_domain) + local DOMAIN=$(analyze_best_domain) local PORT=$(find_smart_port) + echo -e " ${GREEN}✓${NC} Итоговый порт: ${WHITE}$PORT${NC}" fix_firewall "$PORT" # Процесс Docker