diff --git a/build/root/install.sh b/build/root/install.sh index d1e4aa3..13385d9 100644 --- a/build/root/install.sh +++ b/build/root/install.sh @@ -130,6 +130,13 @@ if [[ $VPN_ENABLED == "yes" ]]; then fi + export VPN_REMOTE=$(echo "${vpn_remote_line}" | grep -P -o -m 1 '(?<=remote\s)[^\s]+' | sed -e 's~^[ \t]*~~;s~[ \t]*$~~') + if [[ ! -z "${VPN_REMOTE}" ]]; then + echo "[info] VPN_REMOTE defined as '${VPN_REMOTE}'" | ts '%Y-%m-%d %H:%M:%.S' + else + 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]*$~~') if [[ ! -z "${VPN_PORT}" ]]; then echo "[info] VPN_PORT defined as '${VPN_PORT}'" | ts '%Y-%m-%d %H:%M:%.S'