diff mbox series

uhttpd: add config option for json_script

Message ID 20210820131112.141077-1-stijn@linux-ipv6.be
State Accepted
Delegated to: Stijn Tintel
Headers show
Series uhttpd: add config option for json_script | expand

Commit Message

Stijn Tintel Aug. 20, 2021, 1:11 p.m. UTC
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 is currently not possible as it would render all other uhttpd
instances unusable.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
---
 package/network/services/uhttpd/Makefile          | 2 +-
 package/network/services/uhttpd/files/uhttpd.init | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Felix Fietkau Aug. 24, 2021, 11:19 a.m. UTC | #1
On 2021-08-20 15:11, Stijn Tintel wrote:
> 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 is currently not possible as it would render all other uhttpd
> instances unusable.
> 
> Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Felix Fietkau <nbd@nbd.name>
diff mbox series

Patch

diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile
index 781512bd99..dce5aa87b8 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:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git
diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init
index e7709941c2..30fd7b4259 100755
--- a/package/network/services/uhttpd/files/uhttpd.init
+++ b/package/network/services/uhttpd/files/uhttpd.init
@@ -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