From f509b2a6741450d39ef3cd3a2db3f096bbfb8f33 Mon Sep 17 00:00:00 2001 From: binhex Date: Mon, 10 Jul 2017 13:33:06 +0100 Subject: [PATCH] add in code to fix up tcp-client name in config --- run/root/start.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/run/root/start.sh b/run/root/start.sh index 5b46bb3..10ce44b 100644 --- a/run/root/start.sh +++ b/run/root/start.sh @@ -126,7 +126,11 @@ else # write env vars to ovpn file (used as phased approach to parse ovpn file) if [[ ! -z "${VPN_PROTOCOL}" ]]; then - sed -i -r "s~^;?proto\s.*~proto ${VPN_PROTOCOL}~g" "${VPN_CONFIG}" + if [[ "${VPN_PROTOCOL}" == "tcp" ]]; then + sed -i -r "s~^;?proto\s.*~proto tcp-client~g" "${VPN_CONFIG}" + else + sed -i -r "s~^;?proto\s.*~proto udp~g" "${VPN_CONFIG}" + fi fi if [[ ! -z "${VPN_REMOTE}" && ! -z "${VPN_PORT}" ]]; then