소스 검색

web: fix letsencrypt renewal

Matthias Herzog 5 년 전
부모
커밋
9b17c05
1개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 10 1
      web/rootfs/etc/cont-init.d/10-config

+ 10 - 1
web/rootfs/etc/cont-init.d/10-config

@@ -18,7 +18,16 @@ if [[ $DISABLE_HTTPS -ne 1 ]]; then
                 -d $LETSENCRYPT_DOMAIN \
                 --agree-tos \
                 --email $LETSENCRYPT_EMAIL
-            cp /defaults/letsencrypt-renew /etc/cron.monthly/
+        fi
+
+        # remove default certbot renewal
+        if [[ -f /etc/cron.d/certbot ]]; then
+            rm /etc/cron.d/certbot
+        fi
+
+        # setup certbot renewal script
+        if [[ ! -f /etc/cron.daily/letencrypt-renew ]]; then
+            cp /defaults/letsencrypt-renew /etc/cron.daily/
         fi
     else
         # use self-signed certs