Set default ports as 1194 for UDP and 443 port for TCP

This commit is contained in:
Stephen KINGER 2016-10-09 13:40:19 +02:00
parent cf5ba27a21
commit ac28a7c3e4

View file

@ -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
: