From 24756231a2dbda33891f187853aba901a89d2775 Mon Sep 17 00:00:00 2001 From: Gzngskxgr20 <74984541+Athameral@users.noreply.github.com> Date: Tue, 23 Apr 2024 01:14:31 +0800 Subject: [PATCH] Update x-ui.sh This commit is to correct the previous one, which cannot handle port range settings correctly. --- x-ui.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x-ui.sh b/x-ui.sh index 073ab63e..591f25a5 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -620,7 +620,8 @@ open_ports() { # Split the range into start and end ports start_port=$(echo $port | cut -d'-' -f1) end_port=$(echo $port | cut -d'-' -f2) - ufw allow $start_port:$end_port + ufw allow $start_port:$end_port/tcp + ufw allow $start_port:$end_port/udp else ufw allow "$port" fi @@ -652,7 +653,8 @@ delete_ports() { start_port=$(echo $port | cut -d'-' -f1) end_port=$(echo $port | cut -d'-' -f2) # Delete the port range - ufw delete allow $start_port:$end_port + ufw delete allow $start_port:$end_port/tcp + ufw delete allow $start_port:$end_port/udp else ufw delete allow "$port" fi