owsd: hotplug: map aliases against interface on ifup

This commit is contained in:
Raphael Derensy 2021-03-15 18:06:08 +01:00 committed by Jakob Olsson
parent 7f3e3d9c3e
commit 051826305e

View file

@ -2,6 +2,19 @@
[ "$ACTION" = ifup ] || exit 0 [ "$ACTION" = ifup ] || exit 0
handle_interface() {
ifname=$(uci get network.$1.ifname)
case "$ifname" in
@*)
alias_interface="$1 $alias_interface"
;;
esac
}
config_load network
config_foreach handle_interface "interface"
compare_owsd_iface() { compare_owsd_iface() {
local interface local interface
@ -11,6 +24,13 @@ compare_owsd_iface() {
/etc/init.d/owsd reload /etc/init.d/owsd reload
exit exit
fi fi
for i in $alias_interface; do
if [ "$INTERFACE" == "$i" ]; then
/etc/init.d/owsd reload
exit
fi
done
} }
config_load owsd config_load owsd