ensure cut port is integer and not string (hostname)

pull/23/merge 4.2.5-1-07
binhex 4 years ago
parent 798297a0d6
commit b7ce500cb8

@ -202,7 +202,7 @@ if [[ $VPN_ENABLED == "yes" ]]; then
continue
fi
vpn_remote_port_cut=$(echo "${vpn_remote_line_item}" | cut -d " " -f2 || true)
vpn_remote_port_cut=$(echo "${vpn_remote_line_item}" | cut -d " " -f2 | grep -P -o '^[\d]{4,5}$' || true)
if [[ -z "${vpn_remote_port_cut}" ]]; then
echo "[warn] VPN configuration file ${VPN_CONFIG} remote port is missing or malformed, assuming port '1194'" | ts '%Y-%m-%d %H:%M:%.S'

Loading…
Cancel
Save