uhttpd: add enable instance option
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 7 Nov 2019 10:40:31 +0000 (11:40 +0100)
committerJohn Crispin <john@phrozen.org>
Wed, 15 Jan 2020 19:16:42 +0000 (20:16 +0100)
With this change it is now possible to switch off single instances of
the uhttpd config. Until now it was only possible to switch all
instances of uhttpd on or off.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
package/network/services/uhttpd/Makefile
package/network/services/uhttpd/files/uhttpd.init

index 36dbe636ae57f8af464dd6d5e28f77fc99b36e82..daa56678540b441b8649e395def2e154855ebf9c 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
index 6322473b97001eb75b236db0e613ef137a83698b..869f79bea20f62ad46b15c256144b9f98fa816eb 100755 (executable)
@@ -98,6 +98,10 @@ start_instance()
        local cfg="$1"
        local realm="$(uci_get system.@system[0].hostname)"
        local listen http https interpreter indexes path handler httpdconf haveauth
+       local enabled
+
+       config_get_bool enabled "$cfg" 'enabled' 1
+       [ $enabled -gt 0 ] || return
 
        procd_open_instance
        procd_set_param respawn