diff --git a/luci-app-macvlan/root/etc/init.d/macvlan b/luci-app-macvlan/root/etc/init.d/macvlan index b82725472..f9a46e2f7 100755 --- a/luci-app-macvlan/root/etc/init.d/macvlan +++ b/luci-app-macvlan/root/etc/init.d/macvlan @@ -55,14 +55,16 @@ _create_interface() { commit macvlan EOF } - logger -t "MACVLAN" "Create interface $_ifname based on $_masterifname" - uci batch <<-EOF - set network.$_ifname=interface - set network.$_ifname.type=macvlan - set network.$_ifname.proto=static - set network.$_ifname.masterintf=$_masterifname - commit network - EOF + [ "$(uci -q get network.$_ifname.masterintf)" != "$_masterifname" ] && { + logger -t "MACVLAN" "Create interface $_ifname based on $_masterifname" + uci batch <<-EOF + set network.$_ifname=interface + set network.$_ifname.type=macvlan + set network.$_ifname.proto=static + set network.$_ifname.masterintf=$_masterifname + commit network + EOF + } } # Configuration by interface