From b98d1ee0e7e6c4da75b2932a453fbf1211c47c79 Mon Sep 17 00:00:00 2001 From: Hai HUANG <101720804+maple367@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:46:16 +0800 Subject: [PATCH] modified: x-ui.sh --- x-ui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-ui.sh b/x-ui.sh index c69bf0fc..e3ed8df1 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -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 # 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 exit 1 fi