diff --git a/build/root/install.sh b/build/root/install.sh index 13385d9..d0bd63c 100644 --- a/build/root/install.sh +++ b/build/root/install.sh @@ -137,7 +137,7 @@ if [[ $VPN_ENABLED == "yes" ]]; then echo "[crit] VPN_REMOTE not found in ${VPN_CONFIG}, exiting..." | ts '%Y-%m-%d %H:%M:%.S' && exit 1 fi - export VPN_PORT=$(echo "${vpn_remote_line}" | grep -P -o -m 1 '(?<=\s)\d{2,5}(?=\s)?+' | sed -e 's~^[ \t]*~~;s~[ \t]*$~~') + export VPN_PORT=$(echo "${vpn_remote_line}" | grep -P -o -m 1 '\d{2,5}(\s?)+(tcp|udp|tcp-client)?$' | grep -P -o -m 1 '\d+' | sed -e 's~^[ \t]*~~;s~[ \t]*$~~') if [[ ! -z "${VPN_PORT}" ]]; then echo "[info] VPN_PORT defined as '${VPN_PORT}'" | ts '%Y-%m-%d %H:%M:%.S' else