gluon/package/gluon-simple-tc/files/etc/hotplug.d/net/50-gluon-simple-tc

27 lines
538 B
Plaintext
Raw Normal View History

2013-10-03 11:59:45 +00:00
[ "$ACTION" = 'add' ] || exit 0
config_load gluon-simple-tc
tc_interface() {
local iface="$1"
config_get ifname "$iface" ifname
[ "$INTERFACE" = "$ifname" ] || return
config_get_bool enabled "$iface" enabled 0
[ "$enabled" -eq 1 ] || return
config_get limit_ingress "$iface" limit_ingress
config_get limit_egress "$iface" limit_egress
2013-10-03 11:59:45 +00:00
[ "$limit_ingress" ] || limit_ingress=-
[ "$limit_egress" ] || limit_egress=-
2013-10-03 11:59:45 +00:00
gluon-simple-tc "$INTERFACE" "$limit_ingress" "$limit_egress"
2013-10-03 11:59:45 +00:00
}
config_foreach tc_interface 'interface'