diff --git a/install.sh b/install.sh index da1d878..3c0805d 100755 --- a/install.sh +++ b/install.sh @@ -3,6 +3,7 @@ set -e source env.sh +export REG_CERT=$(echo "$REG_CERT" | base64 -w 0) #get all supervisor ips, there may be a better way? echo "getting supervisor vm creds" diff --git a/proxy.sh b/proxy.sh index 92c5681..b95ced3 100755 --- a/proxy.sh +++ b/proxy.sh @@ -13,7 +13,6 @@ run_interval=${INTERVAL:=30} function inject_ca() { touch /etc/ssl/certs/regcert.pem - echo "$REG_CERT" > /etc/ssl/certs/regcert.pem.new echo "checking if cert exists" if cmp -s "/etc/ssl/certs/regcert.pem.new" "/etc/ssl/certs/regcert.pem"; then echo "the cert already exists and has not changed" @@ -110,6 +109,7 @@ function run() echo no CA cert providied skipping cert injection... else $(typeset -f inject_ca) + echo "${REG_CERT}" | base64 -d > /etc/ssl/certs/regcert.pem.new inject_ca fi