diff mbox series

[OpenWrt-Devel,1/1] uhttpd: add enable instance option

Message ID 20191107104031.31543-1-fe@dev.tdt.de
State Accepted
Delegated to: John Crispin
Headers show
Series [OpenWrt-Devel,1/1] uhttpd: add enable instance option | expand

Commit Message

Florian Eckert Nov. 7, 2019, 10:40 a.m. UTC
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          | 2 +-
 package/network/services/uhttpd/files/uhttpd.init | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

John Crispin Jan. 15, 2020, 7:17 p.m. UTC | #1
On 07/11/2019 11:40, Florian Eckert wrote:
> 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>
Merged, thanks !

> ---
>   package/network/services/uhttpd/Makefile          | 2 +-
>   package/network/services/uhttpd/files/uhttpd.init | 4 ++++
>   2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile
> index 85b7be7607..2d1fbf4492 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:=4
> +PKG_RELEASE:=5
>   
>   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 6322473b97..869f79bea2 100755
> --- a/package/network/services/uhttpd/files/uhttpd.init
> +++ b/package/network/services/uhttpd/files/uhttpd.init
> @@ -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
>
diff mbox series

Patch

diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile
index 85b7be7607..2d1fbf4492 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:=4
+PKG_RELEASE:=5
 
 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 6322473b97..869f79bea2 100755
--- a/package/network/services/uhttpd/files/uhttpd.init
+++ b/package/network/services/uhttpd/files/uhttpd.init
@@ -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