Add option for days until renewal
authorJannis Pinter <jannis+openwrt@pinterjann.is>
Thu, 29 Oct 2020 09:25:26 +0000 (10:25 +0100)
committerToke Høiland-Jørgensen <toke@toke.dk>
Thu, 29 Oct 2020 09:44:57 +0000 (10:44 +0100)
Signed-off-by: Jannis Pinter <jannis+openwrt@pinterjann.is>
net/acme/Makefile
net/acme/files/run.sh

index 37ba33aafc9702781485c61f2552ff89d53ce2ef..0ac93a96985bb43676df31b621ed913ff8b3a934 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=acme
 PKG_VERSION:=2.8.7
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/acmesh-official/acme.sh/tar.gz/$(PKG_VERSION)?
index a605ea59a2bda96b38f6149f17ea463dc945d72d..9cc8e35972dd8d58a585660e62526cfc22f307a0 100644 (file)
@@ -211,6 +211,7 @@ issue_cert()
        local ret
        local domain_dir
        local acme_server
+       local days
 
        config_get_bool enabled "$section" enabled 0
        config_get_bool use_staging "$section" use_staging
@@ -225,6 +226,7 @@ issue_cert()
        config_get user_setup "$section" user_setup
        config_get user_cleanup "$section" user_cleanup
        config_get acme_server "$section" acme_server
+       config_get days "$section" days
 
        UPDATE_NGINX=$update_nginx
        UPDATE_UHTTPD=$update_uhttpd
@@ -284,6 +286,11 @@ issue_cert()
                acme_args="$acme_args --server $acme_server"
        fi
 
+       if [ -n "$days" ]; then
+               log "Renewing after $days days"
+               acme_args="$acme_args --days $days"
+       fi
+
        if [ -n "$dns" ]; then
                log "Using dns mode"
                acme_args="$acme_args --dns $dns"