From 6f96e30829e481ecfb47fc0942801f206439d194 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 12 Apr 2018 10:27:00 +0200 Subject: [PATCH 1/2] mwan3: in ubus rpcd script fix shell local issue To fix the shell local issue in the ubus mwan3 rpcd shell script, move the switch case statment into a function. Signed-off-by: Florian Eckert --- net/mwan3/files/usr/libexec/rpcd/mwan3 | 111 +++++++++++++------------ 1 file changed, 58 insertions(+), 53 deletions(-) diff --git a/net/mwan3/files/usr/libexec/rpcd/mwan3 b/net/mwan3/files/usr/libexec/rpcd/mwan3 index a772e133e8..c30b6a1b93 100755 --- a/net/mwan3/files/usr/libexec/rpcd/mwan3 +++ b/net/mwan3/files/usr/libexec/rpcd/mwan3 @@ -74,60 +74,65 @@ get_mwan3_status() { fi } -case "$1" in - list) - json_init - json_add_object "status" - json_add_string "section" "x" - json_add_string "interface" "x" - json_close_object - json_dump - ;; - call) - case "$2" in - status) - local section iface - read input; - json_load "$input" - json_get_var section section - json_get_var iface interface +main () { - config_load mwan3 + case "$1" in + list) json_init - case "$section" in - interfaces) - json_add_object interfaces - config_foreach get_mwan3_status interface "${iface}" - json_close_object - ;; - connected) - json_add_object connected - json_add_array ipv4 - report_connected_v4 - json_close_array - json_add_array ipv6 - report_connected_v6 - json_close_array - json_close_object - ;; - *) - # interfaces - json_add_object interfaces - config_foreach get_mwan3_status interface - json_close_object - # connected - json_add_object connected - json_add_array ipv4 - report_connected_v4 - json_close_array - json_add_array ipv6 - report_connected_v6 - json_close_array - json_close_object - ;; - esac + json_add_object "status" + json_add_string "section" "x" + json_add_string "interface" "x" + json_close_object json_dump ;; - esac - ;; -esac + call) + case "$2" in + status) + local section iface + read input; + json_load "$input" + json_get_var section section + json_get_var iface interface + + config_load mwan3 + json_init + case "$section" in + interfaces) + json_add_object interfaces + config_foreach get_mwan3_status interface "${iface}" + json_close_object + ;; + connected) + json_add_object connected + json_add_array ipv4 + report_connected_v4 + json_close_array + json_add_array ipv6 + report_connected_v6 + json_close_array + json_close_object + ;; + *) + # interfaces + json_add_object interfaces + config_foreach get_mwan3_status interface + json_close_object + # connected + json_add_object connected + json_add_array ipv4 + report_connected_v4 + json_close_array + json_add_array ipv6 + report_connected_v6 + json_close_array + json_close_object + ;; + esac + json_dump + ;; + esac + ;; + esac +} + +main "$@" From 6b0a65b1833b4c290a0e3c5c7e761a50f3e11307 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 12 Apr 2018 11:22:26 +0200 Subject: [PATCH 2/2] net/mwan3: update version to 2.6.14 Signed-off-by: Florian Eckert --- net/mwan3/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mwan3/Makefile b/net/mwan3/Makefile index 5295f3498b..22a57824f3 100644 --- a/net/mwan3/Makefile +++ b/net/mwan3/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwan3 -PKG_VERSION:=2.6.13 +PKG_VERSION:=2.6.14 PKG_RELEASE:=1 PKG_MAINTAINER:=Florian Eckert PKG_LICENSE:=GPLv2