Skip to content

Commit

Permalink
encode cert to handle newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
warroyo committed Oct 15, 2020
1 parent 09ec462 commit ec5fe96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ec5fe96

Please sign in to comment.