[openwrt/openwrt] uhttpd: use acme hotplug

LEDE Commits lede-commits at lists.infradead.org
Mon Oct 17 23:38:26 PDT 2022


ynezz pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/1bd63df263c485c0716acda03979d37f4e9d3943

commit 1bd63df263c485c0716acda03979d37f4e9d3943
Author: Glen Huang <i at glenhuang.com>
AuthorDate: Sun Oct 16 12:55:07 2022 +0800

    uhttpd: use acme hotplug
    
    Reload uhttpd after certificates are renewed with acme.
    
    Reviewed-by: Toke Høiland-Jørgensen <toke at toke.dk>
    Signed-off-by: Glen Huang <i at glenhuang.com>
---
 package/network/services/uhttpd/Makefile           | 4 +++-
 package/network/services/uhttpd/files/acme.hotplug | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile
index 36331857fb..3258b70c85 100644
--- a/package/network/services/uhttpd/Makefile
+++ b/package/network/services/uhttpd/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uhttpd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git
@@ -113,6 +113,8 @@ define Package/uhttpd/install
 	$(VERSION_SED_SCRIPT) $(1)/etc/config/uhttpd
 	$(INSTALL_DIR) $(1)/usr/sbin
 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/uhttpd $(1)/usr/sbin/uhttpd
+	$(INSTALL_DIR) $(1)/etc/hotplug.d/acme
+	$(INSTALL_DATA) ./files/acme.hotplug $(1)/etc/hotplug.d/acme/00-uhttpd
 endef
 
 define Package/uhttpd-mod-lua/install
diff --git a/package/network/services/uhttpd/files/acme.hotplug b/package/network/services/uhttpd/files/acme.hotplug
new file mode 100644
index 0000000000..ace15e09c9
--- /dev/null
+++ b/package/network/services/uhttpd/files/acme.hotplug
@@ -0,0 +1,3 @@
+if [ "$ACTION" = renewed ]; then
+	/etc/init.d/uhttpd reload
+fi




More information about the lede-commits mailing list