From 177e9ddd7cd8beae91347ca245e8d18f61efcfe0 Mon Sep 17 00:00:00 2001 From: Pagan Gazzard Date: Fri, 28 Aug 2015 15:06:27 +0100 Subject: [PATCH] Specify vpn endpoint in the config file --- tools/dind/config/env | 1 + tools/dind/config/openvpn/{client.conf => client.conf.tmpl} | 2 +- tools/dind/vpn-init | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) rename tools/dind/config/openvpn/{client.conf => client.conf.tmpl} (86%) diff --git a/tools/dind/config/env b/tools/dind/config/env index 107052f7..db0de4a3 100644 --- a/tools/dind/config/env +++ b/tools/dind/config/env @@ -6,6 +6,7 @@ PUBNUB_PUBLISH_KEY=pub-c-bananas MIXPANEL_TOKEN=bananasbananas LISTEN_PORT=48484 RESIN_SUPERVISOR_SECRET=bananas +VPN_ENDPOINT=vpn.resinstaging.io SUPERVISOR_IMAGE= LED_FILE=/dev/null diff --git a/tools/dind/config/openvpn/client.conf b/tools/dind/config/openvpn/client.conf.tmpl similarity index 86% rename from tools/dind/config/openvpn/client.conf rename to tools/dind/config/openvpn/client.conf.tmpl index 6c9deab7..63687add 100644 --- a/tools/dind/config/openvpn/client.conf +++ b/tools/dind/config/openvpn/client.conf.tmpl @@ -1,5 +1,5 @@ client -remote vpn.resinstaging.io 443 +remote #{VPN_ENDPOINT} 443 resolv-retry infinite remote-cert-tls server diff --git a/tools/dind/vpn-init b/tools/dind/vpn-init index ede6af58..cbc49077 100755 --- a/tools/dind/vpn-init +++ b/tools/dind/vpn-init @@ -1,4 +1,6 @@ #!/bin/bash +sed --expression="s/#{VPN_ENDPOINT}/${VPN_ENDPOINT}/" /etc/openvpn/client.conf.tmpl > /etc/openvpn/client.conf + while true; do if [ `jq ".uuid | length" $CONFIG_PATH` -eq 0 ]; then echo "UUID missing from config file, VPN cannot connect"