mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-13 11:34:31 +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={
|
:foreach bridge in=[ / interface bridge find ] do={
|
||||||
:local brname [ / interface bridge get $bridge name ];
|
:local brname [ / interface bridge get $bridge name ];
|
||||||
|
: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={
|
:if ([ / interface bridge port print count-only where bridge=$brname and inactive=no ] = 0) do={
|
||||||
/ ip address disable [ find where !dynamic interface=$brname ];
|
/ ip address disable [ find where !dynamic interface=$brname ];
|
||||||
} else={
|
} else={
|
||||||
/ ip address enable [ find where !dynamic interface=$brname ];
|
/ ip address enable [ find where !dynamic interface=$brname ];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue