From efbb10ae8ad4c5506fd8818db85422699336d3d1 Mon Sep 17 00:00:00 2001 From: hanez Date: Thu, 21 Nov 2024 05:16:17 +0100 Subject: [PATCH] Rewrote ac.sh to be capable of beeing run as a cron job. --- bin/ac.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/bin/ac.sh b/bin/ac.sh index 43b597a6..e5dc1882 100755 --- a/bin/ac.sh +++ b/bin/ac.sh @@ -1,5 +1,22 @@ #!/bin/bash +cd /etc/lighttpd/vhosts.d + +HOSTS="de.hacknf.lists +de.waffelgut +org.linspector +org.xw3.cloud +org.xw3.git +org.xw3.lists +org.xw3.mail +org.xw3.siem +org.xw3.sql" + +for host in $HOSTS; do + cat /etc/lighttpd/vhosts.d/$host.conf.min > /etc/lighttpd/vhosts.d/$host.conf +done +/etc/init.d/lighttpd restart + mv /root/.acme.sh/acme.sh.log /root/.acme.sh/$(date +%s).log acme.sh --cron --force --home /root/.acme.sh @@ -10,8 +27,13 @@ for host in $(ls /etc/acme | tr '\n' ' '); do cat /etc/acme/$host/fullchain.cer >> /etc/acme/$host/$host.pem done +for host in $HOSTS; do + cat /etc/lighttpd/vhosts.d/$host.conf.full > /etc/lighttpd/vhosts.d/$host.conf +done /etc/init.d/lighttpd restart -/etc/init.d/nginx restart + +#/etc/init.d/nginx restart + /etc/init.d/prosody restart cat /etc/acme/mail.xw3.org/fullchain.cer > /opt/mailcow-dockerized/data/assets/ssl/mail.xw3.org/cert.pem