1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 18:41:51 +00:00

Remove macvlan when removed

This commit is contained in:
Ycarus 2018-02-24 10:19:34 +01:00
parent 13bd922d30
commit 92fbb3144f

View file

@ -12,8 +12,6 @@ _setup_macaddr() {
# Configuration by interface
_setup_interface() {
uci -q get "network.$1_dev.ifname" >/dev/null && return
# do not create macvlan for vlan
local _ifname
config_get _ifname "$1" ifname
@ -23,6 +21,17 @@ _setup_interface() {
local _type
config_get _type "$1" type
uci -q get "network.$1_dev.ifname" >/dev/null && {
[ "$_type" = "macvlan" ] || {
uci -q batch <<-EOF
delete network.$1_dev
commit network
EOF
}
return 0
}
[ "$_type" = "macvlan" ] || return 0
uci -q batch <<-EOF