From b7ce500cb84539ed6cf0b6a81e88df72eb75f118 Mon Sep 17 00:00:00 2001 From: binhex Date: Tue, 29 Sep 2020 11:25:51 +0100 Subject: [PATCH] ensure cut port is integer and not string (hostname) --- build/root/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/root/install.sh b/build/root/install.sh index 4fce024..0ffac8a 100644 --- a/build/root/install.sh +++ b/build/root/install.sh @@ -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'