map-controller: config: add name to unique sections

channel_plan and sta_steering are unique sections, and should be named. Additionally added uci-default script to name the sections if missing
This commit is contained in:
Jakob Olsson 2025-09-23 11:27:32 +02:00
parent bf06544066
commit b23e510dd3
2 changed files with 20 additions and 2 deletions

View file

@ -10,7 +10,7 @@ config controller 'controller'
option stale_sta_timeout '20d'
option de_collect_interval '60'
config sta_steering
config sta_steering 'sta_steering'
option enable_sta_steer '1'
option enable_bsta_steer '0'
option rcpi_threshold_2g '70'
@ -23,7 +23,7 @@ config sta_steering
option plugins_policy 'any'
list plugins 'rcpi'
config channel_plan
config channel_plan 'channel_plan'
option preclear_dfs '0'
option acs '0'

View file

@ -0,0 +1,18 @@
#!/bin/sh
. /lib/functions.sh
cfg=mapcontroller
# singleton sections
sections="channel_plan sta_steering"
for sec in $sections; do
# find unnamed section of given type, only index 0
s=$(uci show $cfg | grep -oE "@${sec}\[0\]" | sort -u)
[ "$s" = "" ] && continue
uci rename $cfg.$s=$sec
done
uci commit $cfg