mcastmngr: fixed uci syntax error in init script

Problem description:
Multiple device section name fetched due
to wild card grep command.

Fix: modified grep command which gets exact device
section name based on device name.
This commit is contained in:
Rohit Topno 2024-01-22 18:45:47 +05:30 committed by Erik Karlsson
parent f735ec7d3e
commit dd55c60bd6

View file

@ -15,7 +15,7 @@ snooping_bridges=
__device_is_bridge() {
local device="$2"
local devsec__="$(uci show network | grep name=.*$device | grep -v ifname | cut -d'.' -f2)"
local devsec__="$(uci show network | grep -F ".name='$device'" | cut -d'.' -f2)"
local sectype="$(uci -q get network.$devsec__)"
local devtype="$(uci -q get network.$devsec__.type)"
[ "$sectype" != "device" -o "$devtype" != "bridge" ] && return 1