mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
mcastmngr: fix ubus call in uci default script
This commit is contained in:
parent
82fe2012eb
commit
cb7256eba9
1 changed files with 11 additions and 10 deletions
|
|
@ -77,31 +77,32 @@ generate_mcast_config(){
|
||||||
uci commit mcast
|
uci commit mcast
|
||||||
}
|
}
|
||||||
|
|
||||||
check_if_upstream_untagged(){
|
interfaces_ok(){
|
||||||
local section_name=$1
|
local section_name=$1
|
||||||
local up_interf=$(uci -q get ${section_name}.upstream_interface)
|
|
||||||
|
|
||||||
|
local up_interf=$(uci -q get ${section_name}.upstream_interface)
|
||||||
|
[ -z "$up_interf" ] && return 1
|
||||||
|
|
||||||
|
local down_interf=$(uci -q get ${section_name}.downstream_interface)
|
||||||
|
[ -z "$down_interf" ] && return 1
|
||||||
|
|
||||||
|
# check if upstream untagged
|
||||||
IFS=" "
|
IFS=" "
|
||||||
for itf in $up_interf; do
|
for itf in $up_interf; do
|
||||||
# check if there exist a device section for this upstream interface, if yes the
|
# check if there exist a device section for this upstream interface, if yes the
|
||||||
# do nothing, if no then split the it at . and use the native interface as
|
# do nothing, if no then split the it at . and use the native interface as
|
||||||
# upstream interface
|
# upstream interface
|
||||||
dev_section=$(ubus call uci get '{"config":"network", "type":"device", "match":{"name":"$itf"}}' | jsonfilter -e @.values | jq keys[])
|
dev_section=$(ubus call uci get '{"config":"network", "type":"device", "match":{"name":"'"$itf"'"}}' | jsonfilter -e @.values | jq keys[])
|
||||||
|
|
||||||
if [ ! -z "$dev_section" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
# mcast config is outdated, simply generate as per new logic
|
# mcast config is outdated, simply generate as per new logic
|
||||||
return
|
[ -z "$dev_section" ] && return 1
|
||||||
done
|
done
|
||||||
|
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if [ -s "/etc/config/mcast" ]; then
|
if [ -s "/etc/config/mcast" ]; then
|
||||||
if uci -q get mcast.@proxy[0] >/dev/null; then
|
if uci -q get mcast.@proxy[0] >/dev/null; then
|
||||||
check_if_upstream_untagged "mcast.@proxy[0]" || exit
|
interfaces_ok "mcast.@proxy[0]" && exit
|
||||||
elif uci -q get mcast.@snooping[0] >/dev/null; then
|
elif uci -q get mcast.@snooping[0] >/dev/null; then
|
||||||
# return if there is any valid content
|
# return if there is any valid content
|
||||||
exit
|
exit
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue