#!/usr/bin/with-contenv sh #shellcheck shell=sh if [ -s "$TASKDDATA/ca.cert.pem" ]; then printf "Server certificates found, not generating any.\n" else # Use the generate script to make the CA and server certificates printf "No server certificates found, generating them...\n" cd /opt/src/taskd/pki || exit 1 ./generate # move generated certs to volumes so they're not lost when the container is # destroyed, and so that they can be accessed from other containers if needed cp ./client.key.pem /ssl_certs/ cp ./client.cert.pem /ssl_certs/ cp ./server.key.pem /ssl_certs/ cp ./server.cert.pem /ssl_certs/ cp ./ca.key.pem /ssl_certs/ cp ./ca.cert.pem /ssl_certs/ cp ./ca.cert.pem /client_certs/ fi