uhttpd: use acme hotplug
authorGlen Huang <i@glenhuang.com>
Sun, 16 Oct 2022 04:55:07 +0000 (12:55 +0800)
committerPetr Štetiar <ynezz@true.cz>
Tue, 18 Oct 2022 06:38:07 +0000 (08:38 +0200)
Reload uhttpd after certificates are renewed with acme.

Reviewed-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Glen Huang <i@glenhuang.com>
package/network/services/uhttpd/Makefile
package/network/services/uhttpd/files/acme.hotplug [new file with mode: 0644]

index 36331857fbdb659de4f41ab988c8b6c7594af3b6..3258b70c855c6edba90e145059f3e7377dbed326 100644 (file)
@@ -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 (file)
index 0000000..ace15e0
--- /dev/null
@@ -0,0 +1,3 @@
+if [ "$ACTION" = renewed ]; then
+       /etc/init.d/uhttpd reload
+fi