mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
36 lines
780 B
Bash
36 lines
780 B
Bash
#!/bin/sh
|
|
|
|
[ "$ACTION" = ifup ] || exit 0
|
|
|
|
. /lib/functions/network.sh
|
|
|
|
network_get_device l3device $INTERFACE
|
|
|
|
[ -n "$l3device" ] || exit 0
|
|
|
|
compare_mcast_proxy_upstream() {
|
|
local upstream
|
|
local mode="$2"
|
|
|
|
if [ "$mode" == "proxy" ]; then
|
|
config_get upstream $1 upstream_interface
|
|
else
|
|
config_get upstream $1 interface
|
|
fi
|
|
|
|
for dev in $upstream; do
|
|
if [ "$l3device" == "$dev" ]; then
|
|
running=$(ubus call service list '{"name": "mcast"}' | jsonfilter -e '@.mcast.instances')
|
|
if [ -z "${running}" ];then
|
|
/etc/init.d/mcast start
|
|
else
|
|
ubus call uci commit '{"config":"mcast"}'
|
|
fi
|
|
exit
|
|
fi
|
|
done
|
|
}
|
|
|
|
config_load mcast
|
|
config_foreach compare_mcast_proxy_upstream "proxy" "proxy"
|
|
config_foreach compare_mcast_proxy_upstream "snooping" "snooping"
|