mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-13 03:24:28 +02:00
ip-addr-bridge: ignore bridges without ports
Bridges are used for loopback... Assume we do not want to disable addresses if the bridge has no ports.
This commit is contained in:
parent
015f8e01b5
commit
cdb85460bd
1 changed files with 6 additions and 4 deletions
|
@ -6,9 +6,11 @@
|
|||
|
||||
:foreach bridge in=[ / interface bridge find ] do={
|
||||
:local brname [ / interface bridge get $bridge name ];
|
||||
:if ([ / interface bridge port print count-only where bridge=$brname and inactive=no ] = 0) do={
|
||||
/ ip address disable [ find where !dynamic interface=$brname ];
|
||||
} else={
|
||||
/ ip address enable [ find where !dynamic interface=$brname ];
|
||||
:if ([ / interface bridge port print count-only where bridge=$brname ] > 0) do={
|
||||
:if ([ / interface bridge port print count-only where bridge=$brname and inactive=no ] = 0) do={
|
||||
/ ip address disable [ find where !dynamic interface=$brname ];
|
||||
} else={
|
||||
/ ip address enable [ find where !dynamic interface=$brname ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue