From 4bd15e1756fad9cb044db785dbf6ce64e0afa645 Mon Sep 17 00:00:00 2001 From: Gordon Stein <7331488+gsteinLTU@users.noreply.github.com> Date: Fri, 28 Jun 2024 12:15:55 -0500 Subject: [PATCH] Write cert to file --- update_caddyfile.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/update_caddyfile.sh b/update_caddyfile.sh index ee4a20b..169fd33 100755 --- a/update_caddyfile.sh +++ b/update_caddyfile.sh @@ -9,11 +9,12 @@ sed -i -e "s/DASH_IP/$DASH_IP/" Caddyfile # Check if CERT and KEY environment variables are set if [[ -n "$CERT" && -n "$KEY" ]]; then + # Write the CERT and KEY to files + echo "$CERT" > cert.pem + echo "$KEY" > key.pem + # Append the TLS configuration to the Caddyfile echo " -tls { - certificate \"$CERT\" - key \"$KEY\" -} +tls cert.pem key.pem " >> Caddyfile fi \ No newline at end of file