From cfa5eed6bd562e563d2efa64eff7a31fe4ffc6e0 Mon Sep 17 00:00:00 2001 From: angristan Date: Sat, 22 Sep 2018 16:17:51 +0200 Subject: [PATCH] Re-add possibility to use a hostname as the endpoint --- openvpn-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index f4de0d8..20bf43a 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -157,10 +157,10 @@ function installOpenVPN () { # If $IP is a private IP address, the server must be behind NAT if echo "$IP" | grep -qE '^(10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.|192\.168)'; then echo "" - echo "It seems this server is behind NAT. What is its public IPv4 address?" + echo "It seems this server is behind NAT. What is its public IPv4 address or hostname?" echo "We need it for the clients to connect to the server." - until [[ "$PUBLICIP" =~ ^((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])$ ]];do - read -rp "Public IPv4 address: " -e PUBLICIP + until [[ "$PUBLICIP" != "" ]]; do + read -rp "Public IPv4 address or hostname: " -e PUBLICIP done fi