uhttpd: add config option for json_script
authorStijn Tintel <stijn@linux-ipv6.be>
Fri, 20 Aug 2021 11:33:51 +0000 (14:33 +0300)
committerStijn Tintel <stijn@linux-ipv6.be>
Tue, 24 Aug 2021 11:45:42 +0000 (14:45 +0300)
Add a config option for json_script instead of unconditionally including
all json files in /etc/uhttpd in every uhttpd instance. This makes it
possible to configure a single instance with an unconditional redirect,
which currently renders all other uhttpd instances unusable.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Felix Fietkau <nbd@nbd.name>
package/network/services/uhttpd/Makefile
package/network/services/uhttpd/files/uhttpd.init

index 781512bd994e96b7ba8fe3c4b6c87a8fc606815e..dce5aa87b8e07c925adb379f81538a8a1f04649d 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uhttpd
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git
index e7709941c22de5bc6d07cc94683fab1e64fdaac6..30fd7b4259d93f275177aba3af3e633df0b13832 100755 (executable)
@@ -196,7 +196,8 @@ start_instance()
                append_bool "$cfg" redirect_https "-q" 0
        }
 
-       for file in /etc/uhttpd/*.json; do
+       config_get json_script "$cfg" json_script
+       for file in $json_script; do
                [ -s "$file" ] && procd_append_param command -H "$file"
        done