From ac28a7c3e4d85e379147f7a4de090c65de058ac2 Mon Sep 17 00:00:00 2001 From: Stephen KINGER Date: Sun, 9 Oct 2016 13:40:19 +0200 Subject: [PATCH] Set default ports as 1194 for UDP and 443 port for TCP --- auto_install/install.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 42b2c8e..32f30da 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -501,7 +501,14 @@ setCustomPort() { do portInvalid="Invalid" - PORT=$(whiptail --title "Default OpenVPN Port" --inputbox "You can modify the default OpenVPN port. \nEnter a new value or hit 'Enter' to retain the default" $r $c 1194 3>&1 1>&2 2>&3) + PROTO=`cat /etc/pivpn/INSTALL_PROTO` + if [ "$PROTO" = "udp" ]; then + DEFAULT_PORT=1194 + else + DEFAULT_PORT=443 + fi + + PORT=$(whiptail --title "Default OpenVPN Port" --inputbox "You can modify the default OpenVPN port. \nEnter a new value or hit 'Enter' to retain the default" $r $c $DEFAULT_PORT 3>&1 1>&2 2>&3) if [[ $? = 0 ]]; then if [[ "$PORT" =~ ^[0-9]+$ ]] && [ "$PORT" -ge 1 -a "$PORT" -le 65535 ]; then :