From 030c2e587c645ecb2711558f785e60df881950f6 Mon Sep 17 00:00:00 2001 From: Luke Browning Date: Fri, 18 Dec 2020 22:45:49 -0500 Subject: [PATCH] Fix IP Regex Refined IP regex to only match IPs within the IPv4 spec. --- openvpn-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 222f15e..c78a3e1 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -254,7 +254,7 @@ function installQuestions () { IP_RANGE="10.8.0.0" ;; 2) - until [[ "$IP_RANGE" =~ ^([0-9]{1,3}\.){3}0$ ]]; do + until [[ "$IP_RANGE" =~ ^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}0$ ]]; do read -rp "Custom IP [x.x.x.0]: " -e -i 10.8.0.0 IP_RANGE done ;;