get-initial-cert.sh

See full article.

#!/usr/bin/env bash

/usr/local/bin/certbot-auto certonly --standalone \
    --manual-public-ip-logging-ok \
    -m admin@${WP_SITE_DOMAIN_NAME} --email admin@${WP_SITE_DOMAIN_NAME} --agree-tos --noninteractive \
    --domain ${WP_SITE_DOMAIN_NAME} --rsa-key-size 2048 && \
    cp -fr /etc/letsencrypt /var/www/html && \
    ln -s ${PERSISTENT_MOUNT_POINT}/letsencrypt/live/${WP_SITE_DOMAIN_NAME} ${PERSISTENT_MOUNT_POINT}/certs && \
    find ${PERSISTENT_MOUNT_POINT} && \
    echo "get-initial-cert.sh ran at `date`" >> ${PERSISTENT_MOUNT_POINT}/get-initial-cert.log