mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-10 04:06:18 +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
|
# Split the range into start and end ports
|
||||||
start_port=$(echo $port | cut -d'-' -f1)
|
start_port=$(echo $port | cut -d'-' -f1)
|
||||||
end_port=$(echo $port | cut -d'-' -f2)
|
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
|
else
|
||||||
ufw allow "$port"
|
ufw allow "$port"
|
||||||
fi
|
fi
|
||||||
|
@ -652,7 +653,8 @@ delete_ports() {
|
||||||
start_port=$(echo $port | cut -d'-' -f1)
|
start_port=$(echo $port | cut -d'-' -f1)
|
||||||
end_port=$(echo $port | cut -d'-' -f2)
|
end_port=$(echo $port | cut -d'-' -f2)
|
||||||
# Delete the port range
|
# 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
|
else
|
||||||
ufw delete allow "$port"
|
ufw delete allow "$port"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue