modified: x-ui.sh

This commit is contained in:
Hai HUANG 2024-02-29 20:46:16 +08:00
parent 3d039ec5da
commit b98d1ee0e7

View file

@ -624,7 +624,7 @@ delete_ports() {
read -p "Enter the ports you want to delete (e.g. 80,443,2053 or range 400-500): " ports read -p "Enter the ports you want to delete (e.g. 80,443,2053 or range 400-500): " ports
# Check if the input is valid # Check if the input is valid
if ! [[ $ports =~ ^([0-9]+|[0-9]+-[0-9]+)(,([0-9]+|[0-9]+-[0-9]+))*$ ]]; then if ! echo "$ports" | grep -Eq "^([0-9]+|[0-9]+-[0-9]+)(,([0-9]+|[0-9]+-[0-9]+))*$"; then
echo "Error: Invalid input. Please enter a comma-separated list of ports or a range of ports (e.g. 80,443,2053 or 400-500)." >&2 echo "Error: Invalid input. Please enter a comma-separated list of ports or a range of ports (e.g. 80,443,2053 or 400-500)." >&2
exit 1 exit 1
fi fi