Felix Fietkau 93d75f8401 bridger: update to Git HEAD (2024-04-15)
3159bbe0a2eb improve isolation when selecting a fixed output port
c77a7a1ff74d nl: fix getting flow offload stats
a08e51e679dd add support for disabling bridge-local flows via config

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-04-15 11:29:24 +02:00

47 lines
776 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (c) 2021 OpenWrt.org
START=19
USE_PROCD=1
PROG=/usr/sbin/bridger
get_defaults() {
cfg="$1"
config_get blacklist "$cfg" blacklist
json_add_array blacklist
for i in $blacklist; do
json_add_string "" "$i"
done
json_close_array
config_get_bool bridge_local "$cfg" bridge_local 0
json_add_boolean bridge_local "$bridge_local"
}
reload_service() {
config_load bridger
json_init
config_foreach get_defaults defaults
ubus call bridger set_config "$(json_dump)"
}
service_triggers() {
procd_add_reload_trigger bridger
}
start_service() {
procd_open_instance
procd_set_param command "$PROG"
procd_set_param respawn
procd_close_instance
}
service_started() {
ubus -t 10 wait_for bridger
[ $? = 0 ] && reload_service
}