#
# See also: https://help.dreamhost.com/hc/en-us/articles/217555707-DNS-API-commands
#
-# Crontab: 0 0 20 */3 * certbot renew
+# Crontab: 0 0 20 Jan,Apr,Jul,Oct * certbot renew
#
# Note: If you symlink /etc/letsencrypt/renewal-hooks/{pre|post|deploy}
# to the proper scripts then all you need is certbox renew. Also
# (c) Copyright 2021, ClearSCM, Inc., all rights reserved
#
################################################################################
-logfile="/tmp/$(basename $0).log"
+certdir=/System/Certificates
+
+mkdir -p $certdir
+
+logfile="$certdir/$(basename $0).log"
+
rm -f $logfile
function log {
# If we get here then new certs are produced but need to be made available
# for importation to the Synology. $certdir is a directory that is on the
# Synology mounted via NFS.
-certdir=/System/Data/Certificates
-
-mkdir -p $certdir
cp /etc/letsencrypt/live/$CERTBOT_DOMAIN/privkey.pem $certdir && chmod 444 $certdir/privkey.pem
cp /etc/letsencrypt/live/$CERTBOT_DOMAIN/cert.pem $certdir && chmod 444 $certdir/cert.pem
cp /etc/letsencrypt/live/$CERTBOT_DOMAIN/chain.pem $certdir && chmod 444 $certdir/chain.pem
#
# See also: https://help.dreamhost.com/hc/en-us/articles/217555707-DNS-API-commands
#
-# Crontab: 0 0 20 */3 * certbot renew
+# Crontab: 0 0 20 Jan,Apr,Jul,Oct * certbot renew
#
# Author: Andrew@DeFaria.com
# Created: Fri 04 Jun 2021 11:20:16 PDT
# (c) Copyright 2021, ClearSCM, Inc., all rights reserved
#
################################################################################
-logfile="/tmp/$(basename $0).log"
+certdir="/System/Certificates"
+
+mkdir -p $certdir
+
+logfile="$certdir/$(basename $0).log"
+
rm -f $logfile
function log {
# Removal is instanteous but propagation will take some time. No need to wait
# around though...
+
+# Now deploy new certs
+/opt/clearscm/bin/certbot_deploy.sh
# onto the Synology. We should have already obtained new Let's
# Encrypt certs and have placed them into /System/Certificates.
# Now we just need to restart nginx on the Synology. This works
-# because /usr/syno/etc/certificates/_archive already has been
+# because /usr/syno/etc/certificate/_archive already has been
# configured to look at /System/Certificates for new certs.
#
# The restarting of nginx on Synology is large and takes time. You
#
# See also: https://help.dreamhost.com/hc/en-us/articles/217555707-DNS-API-commands
#
-# Crontab: 0 0 20 */3 * certbot renew
+# Crontab: 0 0 20 Jan,Apr,Jul,Oct * certbot renew
#
# Author: Andrew@DeFaria.com
# Created: Mon Oct 24 11:53:38 AM PDT 2022
# (c) Copyright 2021, ClearSCM, Inc., all rights reserved
#
################################################################################
-logfile="/tmp/$(basename $0).log"
+certdir="/System/Certificates"
+
+mkdir -p $certdir
+
+logfile="$certdir/$(basename $0).log"
+
rm -f $logfile
function log {