16 lines
301 B
Bash
Executable File
16 lines
301 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
if [[ -f "/certs/key.pem" ]] && [[ -f "/certs/cert.pem" ]]; then
|
|
cat <<EOF >> /etc/caddy/endpoint
|
|
https://:8000 {
|
|
tls /certs/cert.pem /certs/key.pem
|
|
EOF
|
|
echo "Configured https"
|
|
else
|
|
echo "http://:8000 {" > /etc/caddy/endpoint
|
|
echo "Configured http"
|
|
fi
|
|
|
|
exec "$@" |