$(INSTALL_CONF) ./files/igmpproxy.config $(1)/etc/config/igmpproxy
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/igmpproxy.init $(1)/etc/init.d/igmpproxy
- $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
- $(INSTALL_BIN) ./files/igmpproxy.hotplug $(1)/etc/hotplug.d/iface/igmpproxy
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/igmpproxy $(1)/usr/sbin/
endef
# OPTIONS="-v" - be verbose, this will write aditional information to syslog
OPTIONS=""
-UPSTREAM=0
igmp_header() {
local quickleave
json_get_var up up
[ -n "$device" -a "$up" = "1" ] || return;
- UPSTREAM=1
-
echo -e "\nphyint $device $direction ratelimit 0 threshold 1" >> /var/etc/igmpproxy.conf
if [ -n "$altnets" ]; then
fi
}
+igmp_add_network() {
+ local network
+
+ config_get network $1 network
+ procd_add_interface_trigger "interface.*" $network /etc/init.d/igmpproxy restart
+}
+
service_triggers() {
procd_add_reload_trigger "igmpproxy"
}
config_foreach igmp_header igmpproxy
config_foreach igmp_add_phyint phyint
- [ $UPSTREAM = 1 ] || return
-
procd_open_instance
procd_set_param command $PROG
[ -n "$OPTIONS" ] && procd_append_param $OPTIONS
procd_append_param command $CONFIGFILE
procd_set_param file $CONFIGFILE
procd_set_param respawn
+ procd_open_trigger
+ config_foreach igmp_add_network phyint
+ procd_close_trigger
procd_close_instance
}