mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-14 21:10:11 +01:00
wifidmd: Update the handling of Multi-AP Mode vendor extension
This commit is contained in:
parent
1d216c4fe6
commit
c81b2dc80c
2 changed files with 45 additions and 4 deletions
|
|
@ -5,7 +5,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wifidmd
|
||||
PKG_VERSION:=1.1.33.9
|
||||
PKG_VERSION:=1.1.34.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@ json_get_var mapcontroller mapcontroller
|
|||
wireless=${wireless:-0}
|
||||
mapcontroller=${mapcontroller:-0}
|
||||
|
||||
# Define function to reload mapcontroller
|
||||
# ------------------------------------------------------
|
||||
# Reload mapcontroller service
|
||||
# ------------------------------------------------------
|
||||
reload_mapcontroller() {
|
||||
pid=$(pidof mapcontroller)
|
||||
if [ -n "$pid" ]; then
|
||||
|
|
@ -54,12 +56,51 @@ reload_mapcontroller() {
|
|||
fi
|
||||
}
|
||||
|
||||
# ------------------------------------------------------
|
||||
# Reload wireless service
|
||||
# ------------------------------------------------------
|
||||
reload_wireless() {
|
||||
log "Reloading wireless config..."
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
}
|
||||
|
||||
# ------------------------------------------------------
|
||||
# Finalize Access Point instances
|
||||
# ------------------------------------------------------
|
||||
finalize_ap_instances() {
|
||||
DMAP_PATH="uci -q -c /etc/bbfdm/dmmap"
|
||||
for sec in $($DMAP_PATH show dmmap_wireless | grep "=wifi-iface" | cut -d. -f2 | cut -d= -f1); do
|
||||
is_new=$($DMAP_PATH get dmmap_wireless.${sec}.__is_new__)
|
||||
[ "${is_new}" = "1" ] || continue
|
||||
|
||||
# Remove the new-instance flag
|
||||
$DMAP_PATH delete dmmap_wireless.${sec}.__is_new__
|
||||
|
||||
# Get the config section name
|
||||
config_sec_name=$($DMAP_PATH get dmmap_wireless.${sec}.section_name)
|
||||
[ -z "${config_sec_name}" ] && continue
|
||||
|
||||
# Get the config section type
|
||||
config_sec_type=$(uci -q get wireless.${config_sec_name})
|
||||
|
||||
if [ "${config_sec_type}" = "wifi-iface" ]; then
|
||||
# New wireless AP instance -> skip mapcontroller reload
|
||||
mapcontroller=0
|
||||
fi
|
||||
done
|
||||
|
||||
# Commit all changes to dmmap_wireless
|
||||
$DMAP_PATH commit dmmap_wireless
|
||||
}
|
||||
|
||||
# Finalize newly created AP AccessPoint instances
|
||||
finalize_ap_instances
|
||||
|
||||
# Apply logic based on flags
|
||||
if [ "$mapcontroller" -eq 1 ]; then
|
||||
reload_mapcontroller
|
||||
elif [ "$wireless" -eq 1 ]; then
|
||||
log "Committing wireless config..."
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
reload_wireless
|
||||
else
|
||||
log "No action needed."
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue