mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-09 19:56:19 +00:00
Update x-ui.sh
This commit is to correct the previous one, which cannot handle port range settings correctly.
This commit is contained in:
parent
06e58840e9
commit
24756231a2
1 changed files with 4 additions and 2 deletions
6
x-ui.sh
6
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
|
||||
|
|
Loading…
Reference in a new issue