[openwrt/openwrt] base-files: uci-defaults: allow setting the number of MACs a radio can use

LEDE Commits lede-commits at lists.infradead.org
Wed Oct 2 06:48:09 PDT 2024


blogic pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e7c7a3c154f2eb83808ec9b3e1a345bda4082781

commit e7c7a3c154f2eb83808ec9b3e1a345bda4082781
Author: John Crispin <john at phrozen.org>
AuthorDate: Sun Sep 22 09:06:10 2024 +0200

    base-files: uci-defaults: allow setting the number of MACs a radio can use
    
    Introduce new uci-default functions:
            - ucidef_set_wireless_mac_count [count]
    
    Signed-off-by: John Crispin <john at phrozen.org>
---
 .../base-files/files/lib/functions/uci-defaults.sh  | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index 4a710aab2c..8355099c35 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -684,6 +684,27 @@ ucidef_set_country() {
 	json_select ..
 }
 
+ucidef_set_wireless_mac_count() {
+	local band="$1"
+	local mac_count="$2"
+
+	case "$band" in
+	2g|5g|6g) ;;
+	*) return;;
+	esac
+	[ -z "$mac_count" ] && return
+
+	json_select_object wlan
+		json_select_object defaults
+			json_select_object ssids
+				json_select_object "$band"
+					json_add_string mac_count "$mac_count"
+				json_select ..
+			json_select ..
+		json_select ..
+	json_select ..
+}
+
 ucidef_set_root_password_plain() {
 	local passwd="$1"
 	json_select_object credentials




More information about the lede-commits mailing list